The Birdfont Source Code
Fix resize transformation in overview
These changes was commited to the Birdfont repository Thu, 23 Nov 2017 20:26:40 +0000.
Contributing
Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
Fix resize transformation in overview
--- a/libbirdfont/ResizeTool.vala
+++ b/libbirdfont/ResizeTool.vala
@@ -375,15 +375,6 @@
foreach (Path selected_path in glyph.active_paths) {
selected_path.resize (ratio_x, ratio_y);
selected_path.reset_stroke ();
- }
-
- // move paths relative to the updated xmin and xmax
- get_selection_min (out selection_minx, out selection_miny);
- dx = resize_pos_x - selection_minx;
- dy = resize_pos_y - selection_miny;
-
- foreach (Path selected_path in glyph.active_paths) {
- selected_path.move (dx, dy);
}
if (glyph.active_paths.size > 0) {
@@ -392,10 +383,8 @@
}
if (!selected) {
- double w;
- w = (ratio_x * glyph.get_width () - glyph.get_width ()) / 2.0;
- glyph.left_limit -= w;
- glyph.right_limit += w;
+ glyph.left_limit *= ratio_x;
+ glyph.right_limit *= ratio_x;
glyph.clear_active_paths ();
glyph.remove_lines ();
glyph.add_help_lines ();
@@ -481,7 +470,7 @@
Glyph glyph = MainWindow.get_current_glyph ();
x = double.MAX;
y = double.MAX;
- foreach (Path p in glyph.active_paths) {
+ foreach (Path p in glyph.active_paths) {
if (p.xmin < x) {
x = p.xmin;
}