mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-06 06:50:07 +00:00
Fix wrong alignment between mouse and sensor threshold position (fix #4428)
This commit is contained in:
parent
92edd5f700
commit
805a8259a1
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2020-2023 Igara Studio S.A.
|
// Copyright (C) 2020-2024 Igara Studio S.A.
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
// the End-User License Agreement for Aseprite.
|
// the End-User License Agreement for Aseprite.
|
||||||
@ -166,7 +166,9 @@ private:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
auto mouseMsg = static_cast<MouseMessage*>(msg);
|
auto mouseMsg = static_cast<MouseMessage*>(msg);
|
||||||
const gfx::Rect rc = bounds();
|
gfx::Rect rc = bounds();
|
||||||
|
rc.shrink(border());
|
||||||
|
rc.shrink(gfx::Border(3, 0, 3, 1) * guiscale());
|
||||||
float u = (mouseMsg->position().x - rc.x) / float(rc.w);
|
float u = (mouseMsg->position().x - rc.x) / float(rc.w);
|
||||||
u = std::clamp(u, 0.0f, 1.0f);
|
u = std::clamp(u, 0.0f, 1.0f);
|
||||||
switch (capture) {
|
switch (capture) {
|
||||||
|
Loading…
Reference in New Issue
Block a user