提交 77509fbc 编写于 作者: W wenquan

修改在顶部导航栏时放大镜位置不准的问题

上级 d261fcbc
......@@ -83,10 +83,11 @@
- (void)setTargetPoint:(CGPoint)targetPoint {
_targetPoint = targetPoint;
if (self.targetWindow) {
CGPoint center = CGPointMake(targetPoint.x, self.center.y);
if (targetPoint.y > CGRectGetHeight(self.bounds) * 0.5) {
center.y = targetPoint.y - CGRectGetHeight(self.bounds) / 2;
}
// CGPoint center = CGPointMake(targetPoint.x, self.center.y);
// if (targetPoint.y > CGRectGetHeight(self.bounds) * 0.5) {
// center.y = targetPoint.y - CGRectGetHeight(self.bounds) / 2;
// }
CGPoint center = CGPointMake(targetPoint.x, targetPoint.y);
self.center = CGPointMake(center.x + self.adjustPoint.x, center.y + self.adjustPoint.y);
[self.layer setNeedsDisplay];
}
......
......@@ -152,7 +152,6 @@ static CGFloat const kColorPickWindowSize = 114;
if (!_magnifierWindow) {
_magnifierWindow = [[DoraemonVisualMagnifierWindow alloc] init];
_magnifierWindow.targetWindow = [[UIApplication sharedApplication].delegate window];
_magnifierWindow.adjustPoint = CGPointMake(0, (kColorPickWindowSize - 6) / 2.0); //放大镜位置调整
_magnifierWindow.magnifierWidth = kColorPickWindowSize - 6; //设置宽度
}
return _magnifierWindow;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册