mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Merge pull request #84 from bcunning/highlight-origin-fix
Fix text highlighting in UIScrollView
This commit is contained in:
@@ -557,6 +557,12 @@ ASDISPLAYNODE_INLINE CGFloat ceilPixelValue(CGFloat f)
|
||||
for (NSValue *rectValue in highlightRects) {
|
||||
CGRect rendererRect = [[self class] _adjustRendererRect:rectValue.CGRectValue forShadowPadding:_shadower.shadowPadding];
|
||||
CGRect highlightedRect = [self.layer convertRect:rendererRect toLayer:highlightTargetLayer];
|
||||
|
||||
// We set our overlay layer's frame to the bounds of the highlight target layer.
|
||||
// Offset highlight rects to avoid double-counting target layer's bounds.origin.
|
||||
highlightedRect.origin.x -= highlightTargetLayer.bounds.origin.x;
|
||||
highlightedRect.origin.y -= highlightTargetLayer.bounds.origin.y;
|
||||
|
||||
[converted addObject:[NSValue valueWithCGRect:highlightedRect]];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user