Commit 0267836
Fix hide layer icon
Changed files (6)
modifiedlibbirdfont/LayerLabel.valamodifiedlibbirdfont/Path.valamodifiedlibbirdfont/QuestionDialog.valamodifiedlibbirdfont/Renderer/Text.valamodifiedresources/icons.bfmodifiedresources/linux/birdfont-autotrace.1
Diff
@@ -188,13 +188,15 @@ public class LayerLabel : Tool { double x = this.x - px; double y = this.y - py; double text_width;+ double visibility_center_y; string visibility; // background if (selected_layer) { cr.save (); Theme.color (cr, "Menu Background");- cr.rectangle (0, y - 2 * Toolbox.get_scale (), w, h); // labels overlap with 2 pixels+ // labels overlap with 2 pixels+ cr.rectangle (0, y - 2 * Toolbox.get_scale (), w, h); cr.fill (); cr.restore (); }@@ -214,7 +216,10 @@ public class LayerLabel : Tool { visibility_icon = new Text (visibility, 30 * Toolbox.get_scale ()); visibility_icon.load_font ("icons.bf"); Theme.text_color (visibility_icon, "Text Tool Box");- visibility_icon.draw_at_top (cr, x, y + h / 2 - (30 * Toolbox.get_scale ()) / 2);+ visibility_center_y = y + h / 2.0;+ visibility_center_y -= visibility_icon.get_height () / 2.0;+ visibility_center_y -= 2;+ visibility_icon.draw_at_top (cr, x, visibility_center_y); cr.restore (); @@ -1,15 +1,15 @@ /*- Copyright (C) 2012, 2013, 2014, 2015 Johan Mattsson+ Copyright (C) 2012 2013 2014 2015 Johan Mattsson - This library is free software; you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 3 of the - License, or (at your option) any later version.+ This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 3 of the + License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details.+ This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. */ using Cairo;@@ -63,8 +63,7 @@ public class QuestionDialog : Dialog { question.layout (); h = question.get_height () + margin;- print (@"question.get_height (): $(question.get_height ())\n");- + foreach (Button button in buttons) { button.widget_x += center; }@@ -227,7 +227,7 @@ public class Text : Widget { public override double get_height () { return font_size; }-+ public double get_acender () { double max_height = 0; @@ -271,6 +271,11 @@ public class Text : Widget { } public double get_decender () {+ double decender_max = get_max_decender ();+ return decender_max > 0 ? decender_max : 0; + } ++ private double get_max_decender () { double decender = 0; double decender_max = 0; @@ -285,9 +290,9 @@ public class Text : Widget { } }); - return decender_max > 0 ? decender_max : 0; - } - + return decender_max; + }+ public override void draw (Context cr) { double descender = cached_font.bottom_limit + cached_font.base_line; double y = widget_y + get_height () + get_font_scale () * descender; // FIXME:@@ -768,7 +768,7 @@ GNU Lesser General Public License</copyright> <selected id="0"/> <glyph id="0" left="-28" right="28"> <layer name= "Layer" visible="true">- <path data="B -17.3586097946,36.3504476040 M 17.0774091627,36.3504476040 M 17.0774091627,41.3109531332 M -17.3586097946,41.3109531332 M -17.3586097946,36.3504476040" />+ <path data="B -17.3586097946,24.4528824410 M 17.0774091627,24.4528824410 M 17.0774091627,29.4133879702 M -17.3586097946,29.4133879702 M -17.3586097946,24.4528824410" /> </layer> </glyph> </collection>@@ -776,8 +776,8 @@ GNU Lesser General Public License</copyright> <selected id="1"/> <glyph id="1" left="-28" right="28"> <layer name= "Layer" visible="true">- <path data="B 7.0995507697,38.9660347552 C 7.0995507697,40.7670109549 6.3054219921,42.6842074200 5.0319395085,43.9576899036 T C 3.7584570250,45.2311723871 1.8412605599,46.0253011647 0.0402843602,46.0253011647 T C -1.7606918395,46.0253011647 -3.6778883047,45.2311723872 -4.9513707882,43.9576899036 T C -6.2248532717,42.6842074200 -7.0189820493,40.7670109549 -7.0189820493,38.9660347552 T C -7.0189820493,37.1650585555 -6.2248532717,35.2478620904 -4.9513707882,33.9743796069 T C -3.6778883046,32.7008971233 -1.7606918395,31.9067683457 0.0402843602,31.9067683457 T C 1.8412605599,31.9067683457 3.7584570249,32.7008971234 5.0319395085,33.9743796069 T C 6.3054219921,35.2478620904 7.0995507697,37.1650585555 7.0995507697,38.9660347552 T" />- <path data="B 9.4785826131,29.3000052448 C 7.0490326436,26.8704552755 3.3914050964,25.3554163390 -0.0444974208,25.3554163390 T C -3.4803999380,25.3554163390 -7.1380274854,26.8704552753 -9.5675774549,29.3000052448 T C -11.9971274241,31.7295552140 -13.5121663604,35.3871827615 -13.5121663604,38.8230852786 T C -13.5121663604,42.2589877958 -11.9971274241,45.9166153433 -9.5675774549,48.3461653127 T C -7.1380274856,50.7757152822 -3.4803999380,52.2907542183 -0.0444974208,52.2907542183 T C 3.3914050964,52.2907542183 7.0490326438,50.7757152820 9.4785826131,48.3461653127 T C 11.9081325825,45.9166153433 13.4231715188,42.2589877958 13.4231715188,38.8230852786 T C 13.4231715188,35.3871827615 11.9081325825,31.7295552140 9.4785826131,29.3000052448 T" />+ <path data="B 7.0995507697,27.3756733094 C 7.0995507697,29.1766495091 6.3054219921,31.0938459742 5.0319395085,32.3673284578 T C 3.7584570250,33.6408109413 1.8412605599,34.4349397189 0.0402843602,34.4349397189 T C -1.7606918395,34.4349397189 -3.6778883047,33.6408109414 -4.9513707882,32.3673284578 T C -6.2248532717,31.0938459742 -7.0189820493,29.1766495091 -7.0189820493,27.3756733094 T C -7.0189820493,25.5746971097 -6.2248532717,23.6575006446 -4.9513707882,22.3840181611 T C -3.6778883046,21.1105356775 -1.7606918395,20.3164068999 0.0402843602,20.3164068999 T C 1.8412605599,20.3164068999 3.7584570249,21.1105356776 5.0319395085,22.3840181611 T C 6.3054219921,23.6575006446 7.0995507697,25.5746971097 7.0995507697,27.3756733094 T" />+ <path data="B 9.4785826131,17.7096437990 C 7.0490326436,15.2800938297 3.3914050964,13.7650548932 -0.0444974208,13.7650548932 T C -3.4803999380,13.7650548932 -7.1380274854,15.2800938295 -9.5675774549,17.7096437990 T C -11.9971274241,20.1391937682 -13.5121663604,23.7968213157 -13.5121663604,27.2327238328 T C -13.5121663604,30.6686263500 -11.9971274241,34.3262538975 -9.5675774549,36.7558038669 T C -7.1380274856,39.1853538364 -3.4803999380,40.7003927725 -0.0444974208,40.7003927725 T C 3.3914050964,40.7003927725 7.0490326438,39.1853538362 9.4785826131,36.7558038669 T C 11.9081325825,34.3262538975 13.4231715188,30.6686263500 13.4231715188,27.2327238328 T C 13.4231715188,23.7968213157 11.9081325825,20.1391937682 9.4785826131,17.7096437990 T" /> </layer> </glyph> </collection>@@ -1,7 +1,7 @@ .TH BIRDFONT-AUTOTRACE 1 LOCAL .SH NAME-birdfont-autotrace - Convert raster image to vecotr graphics+birdfont-autotrace - Convert raster image to vector graphics .SH SYNOPSIS .B birdfont-import birdfont-file svg-files ... .SH DESCRIPTION