The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix home key in text area

These changes was commited to the Birdfont repository Fri, 26 Jun 2015 16:13:06 +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>
Fri, 26 Jun 2015 16:13:06 +0000 (18:13 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 26 Jun 2015 16:13:06 +0000 (18:13 +0200)
commit ce7e016a6e348f771e84d45592a00d32c46cdc6f
tree 9598b33c5740e5dc53014b71972f6262af0a3ace
parent 0b30008e7dba84c58657ace6fc198296394a25a8
Fix home key in text area

libbirdfont/Renderer/TextArea.vala
scripts/complete_translations.py
scripts/release.sh
--- a/libbirdfont/Renderer/TextArea.vala +++ b/libbirdfont/Renderer/TextArea.vala @@ -653,9 +653,8 @@ } public void move_carret_to_beginning_of_line () { - carret = get_carret_at (0, carret.desired_y, false); + carret = get_carret_at (widget_x, carret.desired_y, false); } - public void move_carret_previous_row () { double nr = -font_size; @@ -780,7 +779,9 @@ return sb.str; } - Carret get_carret_at (double click_x, double click_y, bool check_boundaries = true) { + Carret get_carret_at (double click_x, double click_y, + bool check_boundaries = true) { + int i = 0; double tx, ty; double p; @@ -800,13 +801,14 @@ if (paragraph.start_y + widget_y - font_size <= click_y <= paragraph.end_y + widget_y + font_size) { foreach (Text next_word in paragraph.words) { - double tt_click = click_y - widget_y - padding + font_size; // - next_word.get_baseline_to_bottom (); //- font_size + next_word.get_baseline_to_bottom (); + double tt_click = click_y - widget_y - padding + font_size; w = next_word.text; + if (next_word.widget_y <= tt_click <= next_word.widget_y + font_size) { p = next_word.get_sidebearing_extent (); - + if ((next_word.widget_y <= tt_click <= next_word.widget_y + font_size) && (next_word.widget_x + widget_x <= click_x <= next_word.widget_x + widget_x + padding + next_word.get_sidebearing_extent ())) {
--- a/scripts/complete_translations.py +++ b/scripts/complete_translations.py @@ -1,4 +1,4 @@ - #!/usr/bin/python + #!/usr/bin/python3 """ Copyright (C) 2015 Johan Mattsson License: LGPL
--- a/scripts/release.sh +++ b/scripts/release.sh @@ -45,7 +45,7 @@ rm -rf birdfont-$version/.gitignore cd birdfont-$version - ./scripts/complete_translations.py -t 93 -i + python3 ./scripts/complete_translations.py -t 93 -i cd .. tar -cf birdfont-$version.tar birdfont-$version