Updated Files
birdfont/GtkWindow.vala |
libbirdfont/DrawingTools.vala |
libbirdfont/StrokeTool.vala |
--- a/birdfont/GtkWindow.vala
+++ b/birdfont/GtkWindow.vala
@@ -71,7 +71,9 @@
description = new DescriptionForm ();
clipboard = Clipboard.get_for_display (get_display (), Gdk.SELECTION_CLIPBOARD);
-
+
+ Signal.connect(this, "notify::is-active", (GLib.Callback) window_focus, null);
+
scrollbar.value_changed.connect (() => {
double p;
@@ -184,6 +186,7 @@
key_press_event.connect ((t, event) => {
if (!GtkWindow.text_input_is_active) {
+ GtkWindow.reset_modifier (event.state);
TabContent.key_press (event.keyval);
}
@@ -208,6 +211,32 @@
MainWindow.open_recent_files_tab ();
}
+ public void window_focus (void* data) {
+ TabContent.key_release ((uint) ' ');
+ }
+
+ public static void reset_modifier (ModifierType flags) {
+ if ((flags & ModifierType.CONTROL_MASK) == 0) {
+ TabContent.key_release (Key.CTRL_RIGHT);
+ TabContent.key_release (Key.CTRL_LEFT);
+ }
+
+ if ((flags & ModifierType.SHIFT_MASK) == 0) {
+ TabContent.key_release (Key.SHIFT_LEFT);
+ TabContent.key_release (Key.SHIFT_RIGHT);
+ }
+
+ if ((flags & ModifierType.MOD1_MASK) == 0) {
+ TabContent.key_release (Key.ALT_LEFT);
+ TabContent.key_release (Key.ALT_RIGHT);
+ }
+
+ if ((flags & ModifierType.MOD5_MASK) == 0) {
+ TabContent.key_release (Key.LOGO_LEFT);
+ TabContent.key_release (Key.LOGO_RIGHT);
+ }
+ }
+
public void font_loaded () {
Font f = BirdFont.get_current_font ();
set_title (@"$(f.full_name)");
@@ -663,6 +692,7 @@
button_press_event.connect ((t, e)=> {
Gtk.Allocation alloc;
get_allocation (out alloc);
+ GtkWindow.reset_modifier (e.state);
tabbar.select_tab_click (e.x, e.y, alloc.width, alloc.height);
queue_draw_area (0, 0, alloc.width, alloc.height);
return true;
@@ -820,12 +850,14 @@
});
button_press_event.connect ((t, e)=> {
+ GtkWindow.reset_modifier (e.state);
+
if (e.type == EventType.BUTTON_PRESS) {
TabContent.button_press (e.button, e.x, e.y);
} else if (e.type == EventType.2BUTTON_PRESS) {
TabContent.double_click (e.button, e.x, e.y);
}
-
+
return true;
});
--- a/libbirdfont/DrawingTools.vala
+++ b/libbirdfont/DrawingTools.vala
@@ -756,6 +756,7 @@
object_stroke = new SpinButton ("object_stroke", t_("Stroke width"));
object_stroke.set_value_round (2);
object_stroke.set_int_step (0.015);
+ object_stroke.set_big_number (true);
object_stroke.new_value_action.connect((self) => {
Font f;
--- a/libbirdfont/StrokeTool.vala
+++ b/libbirdfont/StrokeTool.vala
@@ -1776,7 +1776,7 @@
l = p2.get_left_handle ();
r = p2.get_right_handle ();
- if (fabs (l.angle - r.angle - PI) % 2 * PI > 0.0001) {
+ if (fabs (l.angle + r.angle - PI) % 2 * PI > 0.0001) {
if (!path.is_open () || i < size - 1) {
get_segment (thickness, 0, 0.001, p2, p3, out start);
add_corner (side1, previous, start, p2.copy (), thickness);