diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2019-05-18 20:00:05 +0000 |
|---|---|---|
| committer | Diederik van Lierop <mail@diedenrezi.nl> | 2019-05-20 16:22:27 +0000 |
| commit | 06a8c1e5f8086e3b3289059b0bc5e1bb4c6e0f8d (patch) | |
| tree | 1fd818b22eb40224d304b3535d5955ed0113fce5 /src/display | |
| parent | More pixel-level alignment fixes for various controls, by making all controls... (diff) | |
| download | inkscape-06a8c1e5f8086e3b3289059b0bc5e1bb4c6e0f8d.tar.gz inkscape-06a8c1e5f8086e3b3289059b0bc5e1bb4c6e0f8d.zip | |
Change the data type of size/width/height of the controls to unsigned int
Diffstat (limited to 'src/display')
| -rw-r--r-- | src/display/guideline.cpp | 4 | ||||
| -rw-r--r-- | src/display/snap-indicator.cpp | 6 | ||||
| -rw-r--r-- | src/display/sodipodi-ctrl.cpp | 8 | ||||
| -rw-r--r-- | src/display/sodipodi-ctrl.h | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/display/guideline.cpp b/src/display/guideline.cpp index 6dcc6d402..8d738cdb2 100644 --- a/src/display/guideline.cpp +++ b/src/display/guideline.cpp @@ -186,11 +186,11 @@ static void sp_guideline_update(SPCanvasItem *item, Geom::Affine const &affine, if (gl->locked) { g_object_set(G_OBJECT(gl->origin), "stroke_color", 0x0000ff88, "shape", SP_CTRL_SHAPE_CROSS, - "size", 7.0, NULL); + "size", 7, NULL); } else { g_object_set(G_OBJECT(gl->origin), "stroke_color", 0xff000088, "shape", SP_CTRL_SHAPE_CIRCLE, - "size", 5.0, NULL); + "size", 5, NULL); } gl->origin->moveto(gl->point_on_line); sp_canvas_item_request_update(SP_CANVAS_ITEM(gl->origin)); diff --git a/src/display/snap-indicator.cpp b/src/display/snap-indicator.cpp index ebd017c64..cb798e612 100644 --- a/src/display/snap-indicator.cpp +++ b/src/display/snap-indicator.cpp @@ -250,7 +250,7 @@ SnapIndicator::set_new_snaptarget(Inkscape::SnappedPoint const &p, bool pre_snap canvasitem = sp_canvas_item_new(_desktop->getTempGroup(), SP_TYPE_CTRL, "anchor", SP_ANCHOR_CENTER, - "size", 11.0, + "size", 11, "stroked", TRUE, "stroke_color", pre_snap ? 0x7f7f7fff : 0xff0000ff, "mode", SP_KNOT_MODE_XOR, @@ -372,7 +372,7 @@ SnapIndicator::set_new_snapsource(Inkscape::SnapCandidatePoint const &p) SPCanvasItem * canvasitem = sp_canvas_item_new( _desktop->getTempGroup(), SP_TYPE_CTRL, "anchor", SP_ANCHOR_CENTER, - "size", 7.0, + "size", 7, "stroked", TRUE, "stroke_color", 0xff0000ff, "mode", SP_KNOT_MODE_XOR, @@ -391,7 +391,7 @@ SnapIndicator::set_new_debugging_point(Geom::Point const &p) SPCanvasItem * canvasitem = sp_canvas_item_new( _desktop->getTempGroup(), SP_TYPE_CTRL, "anchor", SP_ANCHOR_CENTER, - "size", 11.0, + "size", 11, "fill_color", 0x00ff00ff, "stroked", FALSE, "mode", SP_KNOT_MODE_XOR, diff --git a/src/display/sodipodi-ctrl.cpp b/src/display/sodipodi-ctrl.cpp index a48ec4cd8..cf0ee2d89 100644 --- a/src/display/sodipodi-ctrl.cpp +++ b/src/display/sodipodi-ctrl.cpp @@ -60,9 +60,9 @@ sp_ctrl_class_init (SPCtrlClass *klass) g_object_class_install_property (g_object_class, ARG_MODE, g_param_spec_int ("mode", "mode", "Mode", 0, G_MAXINT, SP_CTRL_MODE_COLOR, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (g_object_class, - ARG_ANCHOR, g_param_spec_int ("anchor", "anchor", "Anchor", 0, G_MAXINT, SP_ANCHOR_CENTER, (GParamFlags) G_PARAM_READWRITE)); + ARG_ANCHOR, g_param_spec_int ("anchor", "anchor", "Anchor", 0, G_MAXUINT, SP_ANCHOR_CENTER, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (g_object_class, - ARG_SIZE, g_param_spec_double ("size", "size", "Size", 0.0, G_MAXDOUBLE, 8.0, (GParamFlags) G_PARAM_READWRITE)); + ARG_SIZE, g_param_spec_uint ("size", "size", "Size", 0, G_MAXINT, 7, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (g_object_class, ARG_ANGLE, g_param_spec_double ("angle", "angle", "Angle", -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (g_object_class, @@ -104,7 +104,7 @@ sp_ctrl_set_property(GObject *object, guint prop_id, const GValue *value, GParam ctrl->anchor = (SPAnchorType) g_value_get_int(value); break; case ARG_SIZE: - ctrl->width = (gint) g_value_get_double(value); + ctrl->width = g_value_get_uint(value); ctrl->height = ctrl->width; ctrl->defined = (ctrl->width > 0); break; @@ -164,7 +164,7 @@ sp_ctrl_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec break; case ARG_SIZE: - g_value_set_double(value, ctrl->width/2.0); + g_value_set_uint(value, ctrl->width); break; case ARG_ANGLE: diff --git a/src/display/sodipodi-ctrl.h b/src/display/sodipodi-ctrl.h index 2d26e3832..184c77eec 100644 --- a/src/display/sodipodi-ctrl.h +++ b/src/display/sodipodi-ctrl.h @@ -47,8 +47,8 @@ struct SPCtrl : public SPCanvasItem { SPCtrlShapeType shape; SPCtrlModeType mode; SPAnchorType anchor; - gdouble width; - gdouble height; + unsigned int width; + unsigned int height; guint defined : 1; guint shown : 1; |
