summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDiederik van Lierop <mailat-signdiedenrezidotnl>2010-02-23 20:47:07 +0000
committerDiederik van Lierop <mailat-signdiedenrezidotnl>2010-02-23 20:47:07 +0000
commita202fbbd5f6368a096e056d05bbd53b77ad753c6 (patch)
treeece227a29cc19db79d715452e408c0a95a512a1a /src
parentBetter URL for unordered_set error message. The new wiki page (diff)
downloadinkscape-a202fbbd5f6368a096e056d05bbd53b77ad753c6.tar.gz
inkscape-a202fbbd5f6368a096e056d05bbd53b77ad753c6.zip
Pen tool in paraxial mode: fix automatic orientation of first line segment
Fixed bugs: - https://launchpad.net/bugs/522335 (bzr r9108)
Diffstat (limited to 'src')
-rw-r--r--src/pen-context.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pen-context.cpp b/src/pen-context.cpp
index bb52b1950..6e545be9d 100644
--- a/src/pen-context.cpp
+++ b/src/pen-context.cpp
@@ -1331,6 +1331,7 @@ spdc_pen_finish_segment(SPPenContext *const pc, Geom::Point const p, guint const
if (pc->polylines_paraxial) {
pen_last_paraxial_dir = pen_next_paraxial_direction(pc, p, pc->p[0], state);
}
+
++pc->num_clicks;
if (!pc->red_curve->is_empty()) {
@@ -1430,7 +1431,11 @@ static int pen_next_paraxial_direction(const SPPenContext *const pc,
* horizontal or vertical segment; for all subsequent mouse clicks, we use the direction
* orthogonal to the last one; pressing Shift toggles the direction
*/
- if (pc->num_clicks == 0) {
+ // num_clicks is not reliable because spdc_pen_finish_segment is sometimes called too early
+ // (on first mouse release), in which case num_clicks immediately becomes 1.
+ // if (pc->num_clicks == 0) {
+
+ if (pc->green_curve->is_empty()) {
// first mouse click
double dist_h = fabs(pt[Geom::X] - origin[Geom::X]);
double dist_v = fabs(pt[Geom::Y] - origin[Geom::Y]);