mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-25 23:37:05 +00:00
Fix regression: line tool draws extra pixels on the canvas edge
How the bug could be reproduced (before this fix): - Select the line tool. - Click and hold down the left mouse button on the canvas to put the first line point. - Drag the mouse outside the canvas and move it around (like trying to put the second point of the line outside the canvas).
This commit is contained in:
parent
63ec1f2ae8
commit
4d9d1f309c
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2020 Igara Studio S.A.
|
// Copyright (C) 2020-2021 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2015 David Capello
|
// Copyright (C) 2001-2015 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -81,11 +81,11 @@ void PointShape::doInkHline(int x1, int y, int x2, ToolLoop* loop)
|
|||||||
}
|
}
|
||||||
// Clipped in X axis
|
// Clipped in X axis
|
||||||
else {
|
else {
|
||||||
x1 = base::clamp(x1, 0, dstw-1);
|
if (x2 < 0 || x1 >= dstw || x2-x1+1 < 1)
|
||||||
x2 = base::clamp(x2, 0, dstw-1);
|
|
||||||
if (x2-x1+1 < 1)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
x1 = base::clamp(x1, 0, dstw-1);
|
||||||
|
x2 = base::clamp(x2, 0, dstw-1);
|
||||||
ink->inkHline(x1, y, x2, loop);
|
ink->inkHline(x1, y, x2, loop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user