summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-10-25 05:35:59 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-10-25 05:35:59 +0000
commita59a2ca83d340cee98fd272f7d7c9d77fcd910f6 (patch)
tree21e63f24a2a66333bf00bd229c3f90f919e4ff41 /src
parentswitch pref/repr utility methods to using long long ints; with (diff)
downloadinkscape-a59a2ca83d340cee98fd272f7d7c9d77fcd910f6.tar.gz
inkscape-a59a2ca83d340cee98fd272f7d7c9d77fcd910f6.zip
implement rendering of clips/masks in outline mode; make all outline colors stored in the prefs
(bzr r1861)
Diffstat (limited to 'src')
-rw-r--r--src/desktop.cpp4
-rw-r--r--src/display/nr-arena-item.cpp29
-rw-r--r--src/preferences-skeleton.h5
3 files changed, 35 insertions, 3 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index d7a081faf..c0548a8d2 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -1344,9 +1344,9 @@ _namedview_modified (SPObject *obj, guint flags, SPDesktop *desktop)
SP_RGBA32_G_U(nv->pagecolor) +
SP_RGBA32_B_U(nv->pagecolor)) >= 384) {
// the background color is light or transparent, use black outline
- SP_CANVAS_ARENA (desktop->drawing)->arena->outlinecolor = 0xff;
+ SP_CANVAS_ARENA (desktop->drawing)->arena->outlinecolor = prefs_get_int_attribute("options.wireframecolors", "onlight", 0xff);
} else { // use white outline
- SP_CANVAS_ARENA (desktop->drawing)->arena->outlinecolor = 0xffffffff;
+ SP_CANVAS_ARENA (desktop->drawing)->arena->outlinecolor = prefs_get_int_attribute("options.wireframecolors", "ondark", 0xffffffff);
}
}
}
diff --git a/src/display/nr-arena-item.cpp b/src/display/nr-arena-item.cpp
index 12312c251..0657144ed 100644
--- a/src/display/nr-arena-item.cpp
+++ b/src/display/nr-arena-item.cpp
@@ -402,7 +402,7 @@ nr_arena_item_invoke_render (NRArenaItem *item, NRRectL const *area,
item->filter->render (item, &ipb);
}
- if (item->clip || item->mask) {
+ if ((item->clip || item->mask) && !outline) {
/* Setup mask pixblock */
NRPixBlock mpb;
nr_pixblock_setup_fast (&mpb, NR_PIXBLOCK_MODE_A8, carea.x0,
@@ -508,6 +508,33 @@ nr_arena_item_invoke_render (NRArenaItem *item, NRRectL const *area,
nr_pixblock_release (&mpb);
/* This pointer wouldn't be valid outside this block, so clear it */
item->background_pb = NULL;
+
+ } else if ((item->clip || item->mask) && outline) {
+ // Render clipped or masked object in outline mode:
+
+ // First, render the object itself
+ unsigned int state = NR_ARENA_ITEM_VIRTUAL (item, render) (item, &carea, dpb, flags);
+ if (state & NR_ARENA_ITEM_STATE_INVALID) {
+ /* Clean up and return error */
+ if (dpb != pb)
+ nr_pixblock_release (dpb);
+ item->state |= NR_ARENA_ITEM_STATE_INVALID;
+ return item->state;
+ }
+
+ guint32 saved_rgba = item->arena->outlinecolor; // save current outline color
+ // render clippath as an object, using a different color
+ if (item->clip) {
+ item->arena->outlinecolor = prefs_get_int_attribute("options.wireframecolors", "clips", 0x00ff00ff); // green clips
+ NR_ARENA_ITEM_VIRTUAL (item->clip, render) (item->clip, &carea, dpb, flags);
+ }
+ // render mask as an object, using a different color
+ if (item->mask) {
+ item->arena->outlinecolor = prefs_get_int_attribute("options.wireframecolors", "masks", 0x0000ffff); // blue masks
+ NR_ARENA_ITEM_VIRTUAL (item->mask, render) (item->mask, &carea, dpb, flags);
+ }
+ item->arena->outlinecolor = saved_rgba; // restore outline color
+
} else {
if (item->render_opacity) { // opacity was already rendered in, just copy to dpb here
nr_blit_pixblock_pixblock(dpb, &ipb);
diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h
index 27df30db0..e833157ed 100644
--- a/src/preferences-skeleton.h
+++ b/src/preferences-skeleton.h
@@ -194,6 +194,11 @@ static char const preferences_skeleton[] =
" <group id=\"compassangledisplay\" value=\"0\"/>\n"
" <group id=\"maskobject\" topmost=\"1\" remove=\"1\"/>\n"
" <group id=\"blurquality\" value=\"0\"/>\n"
+" <group id=\"wireframecolors\" "
+" onlight=\"255\"" // 000000ff
+" ondark=\"4294967295\"" //ffffffff
+" clips=\"16711935\"" // 00ff00ff
+" masks=\"65535\"/>\n" // 0x0000ffff
" </group>\n"
"\n"
" <group id=\"extensions\">"