mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-29 12:32:52 +00:00
Add line length in status bar (fix #915)
This commit is contained in:
parent
065188aea3
commit
0993069e0b
Binary file not shown.
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@ -409,6 +409,7 @@
|
||||
<part id="icon_end" x="192" y="264" w="8" h="8" />
|
||||
<part id="icon_angle" x="200" y="264" w="8" h="8" />
|
||||
<part id="icon_key" x="208" y="264" w="8" h="8" />
|
||||
<part id="icon_distance" x="216" y="264" w="8" h="8" />
|
||||
</parts>
|
||||
|
||||
<stylesheet>
|
||||
|
@ -201,12 +201,15 @@ public:
|
||||
if (stroke.size() < 2)
|
||||
return;
|
||||
|
||||
int w = ABS(stroke[1].x-stroke[0].x)+1;
|
||||
int h = ABS(stroke[1].y-stroke[0].y)+1;
|
||||
|
||||
char buf[1024];
|
||||
sprintf(buf, ":start: %3d %3d :end: %3d %3d :size: %3d %3d :angle: %.1f",
|
||||
sprintf(buf, ":start: %3d %3d :end: %3d %3d :size: %3d %3d :distance: %.1f :angle: %.1f",
|
||||
stroke[0].x, stroke[0].y,
|
||||
stroke[1].x, stroke[1].y,
|
||||
ABS(stroke[1].x-stroke[0].x)+1,
|
||||
ABS(stroke[1].y-stroke[0].y)+1,
|
||||
w, h,
|
||||
std::sqrt(w*w + h*h),
|
||||
180.0 * std::atan2(static_cast<double>(stroke[0].y-stroke[1].y),
|
||||
static_cast<double>(stroke[1].x-stroke[0].x)) / PI);
|
||||
text = buf;
|
||||
|
Loading…
x
Reference in New Issue
Block a user