diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-08-02 08:18:13 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-08-02 08:18:13 +0200 |
commit | f31a6363c496ded45d6c4fecf1ca93df619b294d (patch) | |
tree | 8f76952cc6699c29e422e414f88f1cb1b097e3a1 /src/gui/piePreviewAddSign.vala | |
parent | 620857a09b64578bbeda46487ad307d0f6116540 (diff) | |
parent | 0b56dfbf01171226a0bb035afcd13358b6477710 (diff) |
Merge tag 'upstream/0.6.4'
Upstream version 0.6.4
Diffstat (limited to 'src/gui/piePreviewAddSign.vala')
-rw-r--r-- | src/gui/piePreviewAddSign.vala | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gui/piePreviewAddSign.vala b/src/gui/piePreviewAddSign.vala index 4a92067..b3f6f7b 100644 --- a/src/gui/piePreviewAddSign.vala +++ b/src/gui/piePreviewAddSign.vala @@ -185,14 +185,18 @@ public class PiePreviewAddSign : GLib.Object { ///////////////////////////////////////////////////////////////////// public void on_mouse_move(double angle) { - double direction = 2.0 * PI * position/parent.slice_count(); - double diff = fabs(angle-direction); + if (parent.slice_count() > 0) { + double direction = 2.0 * PI * position/parent.slice_count(); + double diff = fabs(angle-direction); - if (diff > PI) - diff = 2 * PI - diff; + if (diff > PI) + diff = 2 * PI - diff; - if (diff < 0.5*PI/parent.slice_count()) this.activity.reset_target(1.0, 1.0); - else this.activity.reset_target(-3.0, 1.5); + if (diff < 0.5*PI/parent.slice_count()) this.activity.reset_target(1.0, 1.0); + else this.activity.reset_target(-3.0, 1.5); + } else { + this.activity.reset_target(1.0, 1.0); + } } ///////////////////////////////////////////////////////////////////// @@ -211,8 +215,8 @@ public class PiePreviewAddSign : GLib.Object { public void on_button_release(double x, double y) { if (this.clicked.end == 0.9) { - this.clicked.reset_target(1.0, 0.1); this.on_clicked((int)this.position); + this.clicked.reset_target(1.0, 0.1); } } } |