[gimp] app: only expose the area covered by the vectors object
- From: Sven Neumann <neo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: only expose the area covered by the vectors object
- Date: Fri, 17 Sep 2010 19:36:06 +0000 (UTC)
commit ae0cf760ab0673658783585bc2a5f29a4dd11cc9
Author: Sven Neumann <sven gimp org>
Date: Fri Sep 17 21:32:38 2010 +0200
app: only expose the area covered by the vectors object
gimp_display_shell_expose_vectors() exposes the bounding box of
the vectors plus a small border.
app/display/gimpdisplayshell-expose.c | 34 +++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 2 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-expose.c b/app/display/gimpdisplayshell-expose.c
index 701c279..c0a5f8f 100644
--- a/app/display/gimpdisplayshell-expose.c
+++ b/app/display/gimpdisplayshell-expose.c
@@ -27,6 +27,8 @@
#include "core/gimpguide.h"
#include "core/gimpsamplepoint.h"
+#include "vectors/gimpvectors.h"
+
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-expose.h"
#include "gimpdisplayshell-transform.h"
@@ -44,6 +46,26 @@ gimp_display_shell_expose_area (GimpDisplayShell *shell,
gtk_widget_queue_draw_area (shell->canvas, x, y, w, h);
}
+static void
+gimp_display_shell_expose_region (GimpDisplayShell *shell,
+ gdouble x1,
+ gdouble y1,
+ gdouble x2,
+ gdouble y2,
+ gint border)
+{
+ const gint x = floor (x1);
+ const gint y = floor (y1);
+ const gint w = ceil (x2) - x;
+ const gint h = ceil (y2) - y;
+
+ gimp_display_shell_expose_area (shell,
+ x - border,
+ y - border,
+ w + 2 * border,
+ h + 2 * border);
+}
+
void
gimp_display_shell_expose_guide (GimpDisplayShell *shell,
GimpGuide *guide)
@@ -111,11 +133,19 @@ void
gimp_display_shell_expose_vectors (GimpDisplayShell *shell,
GimpVectors *vectors)
{
+ gdouble x1, y1;
+ gdouble x2, y2;
+
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
g_return_if_fail (vectors != NULL);
- // FIXME
- gimp_display_shell_expose_full (shell);
+ if (gimp_vectors_bounds (vectors, &x1, &y1, &x2, &y2))
+ {
+ gimp_display_shell_transform_xy_f (shell, x1, y1, &x1, &y1, FALSE);
+ gimp_display_shell_transform_xy_f (shell, x2, y2, &x2, &y2, FALSE);
+
+ gimp_display_shell_expose_region (shell, x1, y1, x2, y2, 2);
+ }
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]