summaryrefslogtreecommitdiffstats
path: root/src/seltrans.cpp
diff options
context:
space:
mode:
authorAntonio Ospite <ao2@ao2.it>2017-07-31 08:20:37 +0000
committerAntonio Ospite <ao2@ao2.it>2017-08-09 14:50:12 +0000
commitfcd4b41f198adbe870c71e820b51e7e9be69d549 (patch)
tree148d1c8cad02dd58e0939ceb2ac592597bf99302 /src/seltrans.cpp
parentFix keyboard shortcuts for changing line spacing. (diff)
downloadinkscape-fcd4b41f198adbe870c71e820b51e7e9be69d549.tar.gz
inkscape-fcd4b41f198adbe870c71e820b51e7e9be69d549.zip
SelTrans: fix inconsistencies with _norm, _grip, and rotation center
There are some inconsistencies when displaying the _norm, _grip, and rotation center handles: 1. _norm and rotation center are not displayed on a black background; 2. _grip is never displayed, even though the code updates its position and even changes its shape depending on the operation performed. Fix these issues by using the XOR blending mode and, since the handles are only visible when dragging, set their color to 0xff0000b0 which is the color used by other handles when they are in the SP_KNOT_STATE_DRAGGING state. Moreover to have _grip properly blended when HANDLE_CENTER is moved _norm must be hidden, otherwise the two control point would overlap (both in shape and position) and the XOR blending would produce an unintuitive result. Finally, to effectively hide _norm, move forcing handles visibility _after_ grab() because grab() shows both _norm and _grip by default. Fixed bugs: - https://bugs.launchpad.net/inkscape/+bug/1707250
Diffstat (limited to 'src/seltrans.cpp')
-rw-r--r--src/seltrans.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/seltrans.cpp b/src/seltrans.cpp
index 1afb71f68..9e18bbe90 100644
--- a/src/seltrans.cpp
+++ b/src/seltrans.cpp
@@ -131,13 +131,13 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) :
_norm = sp_canvas_item_new(desktop->getControls(),
SP_TYPE_CTRL,
"anchor", SP_ANCHOR_CENTER,
- "mode", SP_CTRL_MODE_COLOR,
+ "mode", SP_CTRL_MODE_XOR,
"shape", SP_CTRL_SHAPE_BITMAP,
"size", 13.0,
"filled", TRUE,
"fill_color", 0x00000000,
"stroked", TRUE,
- "stroke_color", 0x000000a0,
+ "stroke_color", 0xff0000b0,
"pixbuf", handles[12],
NULL);
@@ -150,7 +150,7 @@ Inkscape::SelTrans::SelTrans(SPDesktop *desktop) :
"filled", TRUE,
"fill_color", 0xffffff7f,
"stroked", TRUE,
- "stroke_color", 0xffffffff,
+ "stroke_color", 0xff0000b0,
"pixbuf", handles[12],
NULL);
@@ -727,12 +727,16 @@ void Inkscape::SelTrans::handleClick(SPKnot */*knot*/, guint state, SPSelTransHa
void Inkscape::SelTrans::handleGrab(SPKnot *knot, guint /*state*/, SPSelTransHandle const &handle)
{
+ grab(knot->position(), handle.x, handle.y, FALSE, FALSE);
+
+ // Forcing handles visibility must be done after grab() to be effective
switch (handle.type) {
case HANDLE_CENTER:
g_object_set(G_OBJECT(_grip),
"shape", SP_CTRL_SHAPE_BITMAP,
"size", 13.0,
NULL);
+ sp_canvas_item_hide(_norm);
sp_canvas_item_show(_grip);
break;
default:
@@ -744,8 +748,6 @@ void Inkscape::SelTrans::handleGrab(SPKnot *knot, guint /*state*/, SPSelTransHan
sp_canvas_item_show(_grip);
break;
}
-
- grab(knot->position(), handle.x, handle.y, FALSE, FALSE);
}