-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
取色器取色点移出屏幕会出现取色异常的bug #21
base: develop_nullsafety
Are you sure you want to change the base?
取色器取色点移出屏幕会出现取色异常的bug #21
Conversation
longer96
commented
Aug 16, 2021
[fix]:ColorSucker move off screen bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议直接修改为限制取色器坐标最大值
setState(() {}); | ||
} | ||
|
||
void _toolBarPanUpdate(DragUpdateDetails dragDetails) { | ||
_toolBarY = dragDetails.globalPosition.dy - 40; | ||
if (_toolBarY <= 0) _toolBarY = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (_toolBarY <= 0) _toolBarY = 0; | |
_toolBarY = max(0, _toolBarY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get ✅
} else if (newY + (_magnifierSize.height / 2) > _windowSize.height) { | ||
newY = _windowSize.height - 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在数值濒临溢出时,newY
的值会被马上设置为屏幕底部边缘值-1,这会导致在取色器濒临触达屏幕底部时产生“吸附”底部的效果,导致无法取到屏幕最底部的色值。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
非常抱歉,我没有完整的测试就提交了代码。我明天加紧修改