summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a9e35ad)
raw | patch | inline | side by side (parent: a9e35ad)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 21 Apr 2007 19:17:47 +0000 (19:17 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 21 Apr 2007 19:17:47 +0000 (19:17 +0000) |
src/dyna-draw-context.cpp | patch | blob | history | |
src/dyna-draw-context.h | patch | blob | history |
index ba8d796a0ef93d6dc05b09451e8506e2a891c6cc..f6f59fe6b375d5fdab3247be36dec9573905f69d 100644 (file)
ddc->trace_bg = false;
ddc->is_dilating = false;
+ ddc->has_dilated = false;
}
static void
if (SP_IS_GROUP(item)) {
for (SPObject *child = sp_object_first_child(SP_OBJECT(item)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM(child)) {
- did = did || sp_ddc_dilate_recursive (SP_ITEM(child), p, expand, radius, offset);
+ if (sp_ddc_dilate_recursive (SP_ITEM(child), p, expand, radius, offset))
+ did = true;
}
}
sp_canvas_force_full_redraw_after_interruptions(desktop->canvas, 3);
dc->is_drawing = true;
+ if (event->button.state & GDK_MOD1_MASK) {
+ dc->is_dilating = true;
+ dc->has_dilated = false;
+ }
}
break;
case GDK_MOTION_NOTIFY:
// dilating:
if (dc->is_drawing && ( event->motion.state & GDK_BUTTON1_MASK ) && event->motion.state & GDK_MOD1_MASK) {
sp_ddc_dilate (dc, desktop->dt2doc(motion_dt), event->motion.state & GDK_SHIFT_MASK? true : false);
- dc->is_dilating = true;
+ dc->has_dilated = true;
// it's slow, so prevent clogging up with events
gobble_motion_events(GDK_BUTTON1_MASK);
return TRUE;
case GDK_BUTTON_RELEASE:
+ {
+ NR::Point const motion_w(event->button.x, event->button.y);
+ NR::Point const motion_dt(desktop->w2d(motion_w));
+
sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate), event->button.time);
sp_canvas_end_forced_full_redraws(desktop->canvas);
dc->is_drawing = false;
if ( dc->is_dilating && event->button.button == 1 ) {
+ if (!dc->has_dilated) {
+ // if we did not rub, do a light tap
+ dc->pressure = 0.03;
+ sp_ddc_dilate (dc, desktop->dt2doc(motion_dt), event->button.state & GDK_SHIFT_MASK? true : false);
+ }
dc->is_dilating = false;
+ dc->has_dilated = false;
sp_document_done(sp_desktop_document(SP_EVENT_CONTEXT(dc)->desktop),
SP_VERB_CONTEXT_CALLIGRAPHIC,
(event->button.state & GDK_SHIFT_MASK ? _("Thicken paths") : _("Thin paths")));
ret = TRUE;
+
} else if ( dc->dragging && event->button.button == 1 ) {
dc->dragging = FALSE;
- NR::Point const motion_w(event->button.x, event->button.y);
- NR::Point const motion_dt(desktop->w2d(motion_w));
sp_dyna_draw_apply(dc, motion_dt);
/* Remove all temporary line segments */
ret = TRUE;
}
break;
+ }
case GDK_KEY_PRESS:
switch (get_group0_keyval (&event->key)) {
index 3bb8ab5f7528a67bb2651e72967e4c14b5372e58..5b81c521ebaafaf3fdec1bc96b27bc7d3ec7f67d 100644 (file)
--- a/src/dyna-draw-context.h
+++ b/src/dyna-draw-context.h
bool trace_bg;
bool is_dilating;
+ bool has_dilated;
SPCanvasItem *dilate_area;
};