[aseprite] 29/128: Add line length in status bar (fix #915)

Tobias Hansen thansen at moszumanska.debian.org
Mon May 9 21:24:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 0993069e0be4bf7f963708d02d56710647f57085
Author: David Capello <davidcapello at gmail.com>
Date:   Tue Apr 19 15:08:36 2016 -0300

    Add line length in status bar (fix #915)
---
 data/skins/default/sheet.png | Bin 14090 -> 14159 bytes
 data/skins/default/skin.xml  |   1 +
 src/app/tools/controllers.h  |   9 ++++++---
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/data/skins/default/sheet.png b/data/skins/default/sheet.png
index 150ff3d..3c61728 100644
Binary files a/data/skins/default/sheet.png and b/data/skins/default/sheet.png differ
diff --git a/data/skins/default/skin.xml b/data/skins/default/skin.xml
index 5ab0a88..bc81e38 100644
--- a/data/skins/default/skin.xml
+++ b/data/skins/default/skin.xml
@@ -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>
diff --git a/src/app/tools/controllers.h b/src/app/tools/controllers.h
index 4cbca8a..28e1eab 100644
--- a/src/app/tools/controllers.h
+++ b/src/app/tools/controllers.h
@@ -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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list