The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

A tool for moving the canvas

These changes was commited to the Birdfont repository Sat, 06 Sep 2014 18:14:26 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Sat, 06 Sep 2014 18:14:26 +0000 (20:14 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sat, 06 Sep 2014 18:14:26 +0000 (20:14 +0200)
commit 26fab179fa58205cfafe98e2e5ac4a77dd1f0360
tree affbf57d775d395c05a15a3c021801a7f70d5982
parent 4c421216c38dd1d79b814eae99d86de0e3140eba
A tool for moving the canvas

graphics/tools_and_buttons.svg
icons/move_canvas.png [new ]
libbirdfont/DrawingTools.vala
libbirdfont/Glyph.vala
--- a/graphics/tools_and_buttons.svg +++ b/graphics/tools_and_buttons.svg @@ -928,6 +928,27 @@ id="linearGradient3443" xlink:href="#linearGradient3761-1-3-9" inkscape:collect="always" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3761-1-3-427" + id="linearGradient4027-81" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.1095097,0,0,0.99800197,-656.63464,-283.00582)" + x1="608.99573" + y1="316.79437" + x2="608.64221" + y2="290.27783" /> + <linearGradient + id="linearGradient3761-1-3-427"> + <stop + style="stop-color:#ededed;stop-opacity:1;" + offset="0" + id="stop3763-4-4-51" /> + <stop + style="stop-color:#ffffff;stop-opacity:1;" + offset="1" + id="stop3765-1-1-17" /> + </linearGradient> </defs> <sodipodi:namedview id="base" @@ -936,9 +957,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1" - inkscape:cx="460.33402" - inkscape:cy="449.0395" + inkscape:zoom="1.4581785" + inkscape:cx="94.371343" + inkscape:cy="546.26425" inkscape:current-layer="layer1" inkscape:document-units="px" showgrid="false" @@ -2715,7 +2736,7 @@ d="m 302.72243,169.5 -10.79194,0.32803 -7.46499,7.80048 -3.64687,-10.16238 -9.7255,-4.68915 8.53805,-6.60872 1.4543,-10.69853 8.92367,6.07796 10.62431,-1.92291 -3.02291,10.36511 z" inkscape:transform-center-x="1.0042155" inkscape:transform-center-y="0.50488206" - transform="matrix(0.91941896,0,0,0.91941896,-36.250098,-119.73613)" + transform="matrix(0.91941896,0,0,0.91941896,-28.70644,-125.90821)" inkscape:export-filename="/home/johan/birdfont/icons/tie_is_active.png" inkscape:export-xdpi="319" inkscape:export-ydpi="319" /> @@ -3273,6 +3294,15 @@ inkscape:export-filename="/home/johan/birdfont/icons/auto_trace_simplify.png" inkscape:export-xdpi="319" inkscape:export-ydpi="319" /> + <path + style="opacity:0.98000004;fill:#e6e6e6;fill-opacity:1;stroke:#858585;stroke-width:0.75193405px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="m 194.53253,55.183454 c -1.31291,-1.72569 -1.56337,-2.15366 -2.78841,-0.92861 -0.25489,0.25489 0.16982,0.86355 0.21679,0.91051 0.47256,0.47256 0.38707,1.38431 0.95388,1.95111 1.00286,1.00287 1.37029,1.28759 2.63624,2.55354 0.96047,0.96045 0.5999,3.33144 0.69373,3.42527 0.76284,0.76284 6.74912,0.88188 7.41421,0.21679 0.31644,-0.31644 -0.11919,-1.19243 0.0867,-1.60424 0.45513,-0.91026 0.56202,-3.08705 1.17842,-4.01163 1.07603,-0.69242 2.01347,-3.07314 2.47483,-4.34159 0.85098,-2.33967 0.70348,-3.75579 -0.94665,-3.03874 -0.49081,0.81585 -0.98886,2.94953 -2.4071,4.11298 0.007,-0.91622 0.15808,-2.37968 0.4884,-3.69291 0.44424,-1.76615 0.9928,-3.30462 -0.13753,-3.29288 -1.096,0.0114 -1.38792,1.44973 -1.79434,2.84649 -0.40388,1.38805 -0.92489,2.73301 -1.16864,3.24157 -0.12571,-0.69754 -0.41273,-2.47914 -0.51284,-4.05879 -0.0956,-1.50931 0.0173,-2.83425 -0.99006,-2.85308 -1.23291,-0.0231 -1.10085,1.43132 -1.08831,3.04608 0.0113,1.45416 -0.0694,3.25932 -0.16002,4.1798 -0.3675,-0.73969 -1.18453,-2.626995 -1.47202,-3.95869 -0.28306,-1.311161 -0.55279,-2.410802 -1.4744,-2.177314 -1.37475,0.348295 -1.11843,1.462864 -0.75826,2.919304 0.50068,2.02469 1.99558,4.53449 0.96408,5.61629 -0.65396,-0.66564 -0.79661,-0.65139 -1.4087,-1.06126 z" + id="path4276-2-3" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cscssssscsccssscssscssscc" + inkscape:export-filename="/home/johan/birdfont/icons/move_canvas.png" + inkscape:export-xdpi="317.09885" + inkscape:export-ydpi="317.09885" /> </g> </svg>
diff --git icons/move_canvas.png(new)
--- /dev/null +++ b/icons/move_canvas.png @@ -1,1 +1,22 @@ - + PNG +  + IHDR<?hsBIT|d pHYs00CtEXtSoftwarewww.inkscape.org< IDATh͛{l}?wǝiQMʂ)m1 + $61YSN + )hZhP B( + A0MuH(TIȅ;1ZrI4_ۻ{#JYovߝ1K!dD ! I)! QDH$^@KOC[h")֪_}7{^O4]=5ñXIӴ٪Ç'搫R@ s=i q9\i1Mi_B7= ឞh4R2 chttV4EnR}DӬ{~KM\όD";)BHpD8eJ?0 "*(=>T;Ys[KZJ:sO8Q]:p}ٓ/_zYI@ `FrZc7JJJ:+p8CR8py|9DXo˾}hmmgqTJٞ9NJaoOOOEXek׮塇rVZeՐ/ kۀ/lذ;}ɓuiEy16H)3+?pZĄu<&iZp)448/8?mya5s=NxܾHPau&ɬ~0BVLIX5q!D:b_6nܘ6?Wǽ + N$]nYYGn !2M1M6u^W6_A ` LNND"vww_B 8~@JNRve;4^~a/WzgCqN#BI}Q0gU^`mZP 'N< + l˜k0x~iF_|7 1'Rë + ˤfy͚5Tݓ6RL0Myy1o;\t 7nBa1NXAiցl֮]6F%,tvh]׿ TlݺN::: "H$bc>Wu7x<)k1JV{ + X VqO$WyIG|><VB P<B3@Y2֭!:R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_tool; TrackTool track_tool; BackgroundTool move_background; + public static Tool move_canvas; Tool quadratic_points; Tool cubic_points; @@ -79,7 +80,7 @@ public Tool inser_point_on_path_tool; Tool undo_tool; Tool select_all_button; - + public DrawingTools (GlyphCanvas main_glyph_canvas) { glyph_canvas = main_glyph_canvas; @@ -143,7 +144,13 @@ update_drawing_and_background_tools (self); }); draw_tools.add_tool (move_background); - + + move_canvas = new Tool ("move_canvas", t_("Move canvas"), 'h'); + move_canvas.select_action.connect ((self) => { + update_drawing_and_background_tools (self); + }); + draw_tools.add_tool (move_canvas); + // Tools on android // Delete key delete_button = new Tool ("delete_button", t_("Delete")); @@ -1314,6 +1321,7 @@ resize_tool.set_selected (false); stroke_tool.set_selected (false); track_tool.set_selected (false); + move_canvas.set_selected (false); show_bg.set_selected (g.get_background_visible ()); show_bg.set_active (false);
--- a/libbirdfont/Glyph.vala +++ b/libbirdfont/Glyph.vala @@ -685,7 +685,7 @@ public override void motion_notify (double x, double y) { Tool t = MainWindow.get_toolbox ().get_current_tool (); - if (view_is_moving && KeyBindings.has_ctrl ()) { + if (view_is_moving) { move_view_offset (x, y); return; } @@ -770,7 +770,7 @@ return; } - if (KeyBindings.has_ctrl ()) { + if (KeyBindings.has_ctrl () || DrawingTools.move_canvas.is_selected ()) { view_is_moving = true; move_offset_x = view_offset_x; move_offset_y = view_offset_y;