summaryrefslogtreecommitdiffstats
path: root/src/display/sp-canvas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/display/sp-canvas.cpp')
-rw-r--r--src/display/sp-canvas.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index cce43825a..88a457490 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -2253,11 +2253,20 @@ bool sp_canvas_world_pt_inside_window(SPCanvas const *canvas, NR::Point const &w
NR::Rect SPCanvas::getViewbox() const
{
GtkWidget const *w = GTK_WIDGET(this);
-
return NR::Rect(NR::Point(dx0, dy0),
NR::Point(dx0 + w->allocation.width, dy0 + w->allocation.height));
}
+/**
+ * Return canvas window coordinates as IRect (a rectangle defined by integers).
+ */
+NR::IRect SPCanvas::getViewboxIntegers() const
+{
+ GtkWidget const *w = GTK_WIDGET(this);
+ return NR::IRect(NR::IPoint(x0, y0),
+ NR::IPoint(x0 + w->allocation.width, y0 + w->allocation.height));
+}
+
inline int sp_canvas_tile_floor(int x)
{
return (x & (~(TILE_SIZE - 1))) / TILE_SIZE;