[dia] Magnifer show selection
- From: Zander <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] Magnifer show selection
- Date: Sun, 12 May 2019 15:02:23 +0000 (UTC)
commit 53fef431b2b51192850a958d5cbdd01e4fe0ce2a
Author: Zander Brown <zbrown gnome org>
Date: Mon Jan 7 22:25:07 2019 +0000
Magnifer show selection
app/magnify.c | 39 +++++++++++----------------------------
1 file changed, 11 insertions(+), 28 deletions(-)
---
diff --git a/app/magnify.c b/app/magnify.c
index 2cc04196..0513be83 100644
--- a/app/magnify.c
+++ b/app/magnify.c
@@ -57,6 +57,11 @@ magnify_button_release(MagnifyTool *tool, GdkEventButton *event,
tool->box_active = FALSE;
+ dia_interactive_renderer_set_selection (ddisp->renderer,
+ FALSE, 0, 0, 0, 0);
+ ddisplay_flush (ddisp);
+
+
visible = &ddisp->visible;
ddisplay_untransform_coords(ddisp, tool->x, tool->y, &p1.x, &p1.y);
@@ -105,37 +110,15 @@ magnify_motion(MagnifyTool *tool, GdkEventMotion *event,
intPoint tl, br;
if (tool->box_active) {
- GdkColor white;
- cairo_t *ctx;
- double dashes[] = { 3 };
-
tool->moved = TRUE;
- color_convert(&color_white, &white);
-
- ctx = gdk_cairo_create(gtk_widget_get_window(ddisp->canvas));
-
- cairo_set_line_width (ctx, 1);
- cairo_set_line_cap (ctx, CAIRO_LINE_CAP_BUTT);
- cairo_set_line_join (ctx, CAIRO_LINE_JOIN_MITER);
- cairo_set_dash (ctx, dashes, 1, 0);
-
- gdk_cairo_set_source_color (ctx, &white);
- cairo_set_operator (ctx, CAIRO_OPERATOR_XOR);
-
- tl.x = MIN(tool->x, tool->oldx); tl.y = MIN(tool->y, tool->oldy);
- br.x = MAX(tool->x, tool->oldx); br.y = MAX(tool->y, tool->oldy);
-
- cairo_rectangle (ctx, tl.x, tl.y, br.x - tl.x, br.y - tl.y);
- cairo_stroke (ctx);
-
- tl.x = MIN(tool->x, event->x); tl.y = MIN(tool->y, event->y);
- br.x = MAX(tool->x, event->x); br.y = MAX(tool->y, event->y);
- cairo_rectangle (ctx, tl.x, tl.y, br.x - tl.x, br.y - tl.y);
- cairo_stroke (ctx);
+ tl.x = MIN (tool->x, event->x); tl.y = MIN (tool->y, event->y);
+ br.x = MAX (tool->x, event->x); br.y = MAX (tool->y, event->y);
- tool->oldx = event->x;
- tool->oldy = event->y;
+ dia_interactive_renderer_set_selection (ddisp->renderer,
+ TRUE,
+ tl.x, tl.y, br.x - tl.x, br.y - tl.y);
+ ddisplay_flush (ddisp);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]