From daa4041065a08cb62c1f006204d2670840bd83cc Mon Sep 17 00:00:00 2001 From: buliabyak Date: Mon, 19 Mar 2007 03:04:08 +0000 Subject: [PATCH] make arena remember its parent canvasarena, if any (so that an arenaitem can get access to the canvas viewbox for picking optimization) --- src/display/canvas-arena.cpp | 1 + src/display/nr-arena.cpp | 1 + src/display/nr-arena.h | 3 +++ 3 files changed, 5 insertions(+) diff --git a/src/display/canvas-arena.cpp b/src/display/canvas-arena.cpp index de43ec80d..bb60cdc93 100644 --- a/src/display/canvas-arena.cpp +++ b/src/display/canvas-arena.cpp @@ -101,6 +101,7 @@ sp_canvas_arena_init (SPCanvasArena *arena) arena->sticky = FALSE; arena->arena = NRArena::create(); + arena->arena->canvasarena = arena; arena->root = NRArenaGroup::create(arena->arena); nr_arena_group_set_transparent (NR_ARENA_GROUP (arena->root), TRUE); diff --git a/src/display/nr-arena.cpp b/src/display/nr-arena.cpp index e6d0105fb..7c0664d16 100644 --- a/src/display/nr-arena.cpp +++ b/src/display/nr-arena.cpp @@ -54,6 +54,7 @@ nr_arena_init (NRArena *arena) arena->delta = 0; // to be set by desktop from prefs arena->rendermode = RENDERMODE_NORMAL; // default is normal render arena->outlinecolor = 0xff; // black; to be set by desktop from bg color + arena->canvasarena = NULL; } static void diff --git a/src/display/nr-arena.h b/src/display/nr-arena.h index 245ce14db..89cb58f39 100644 --- a/src/display/nr-arena.h +++ b/src/display/nr-arena.h @@ -36,6 +36,8 @@ enum { RENDERMODE_OUTLINE }; +struct SPCanvasArena; + struct NRArena : public NRActiveObject { static NRArena *create() { return reinterpret_cast(nr_object_new(NR_TYPE_ARENA)); @@ -44,6 +46,7 @@ struct NRArena : public NRActiveObject { double delta; int rendermode; guint32 outlinecolor; + SPCanvasArena *canvasarena; // may be NULL is this arena is not the screen but used for export etc. }; struct NRArenaClass : public NRActiveObjectClass { -- 2.30.2