summaryrefslogtreecommitdiff
path: root/libs/canvas/types.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-06-24 16:28:53 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-06-24 16:28:53 -0400
commita1f858d3b207739e0719c1fc28003f1d9dd3965d (patch)
tree23c9c35f6b95e116f11354b0c78841036dcdc6bb /libs/canvas/types.cc
parent0ce393f05144762a20d72975d0254ebca0789973 (diff)
an awful lot of tweaks to drawing details
Diffstat (limited to 'libs/canvas/types.cc')
-rw-r--r--libs/canvas/types.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/libs/canvas/types.cc b/libs/canvas/types.cc
index dfd934b126..a8c690bbbe 100644
--- a/libs/canvas/types.cc
+++ b/libs/canvas/types.cc
@@ -20,6 +20,9 @@
#include <algorithm>
#include <cfloat>
#include <cassert>
+
+#include <cairomm/context.h>
+
#include "canvas/types.h"
using namespace std;
@@ -118,6 +121,39 @@ Rect::fix () const
return r;
}
+Rect
+Rect::convert_to_device (Cairo::RefPtr<Cairo::Context> c) const
+{
+ Coord xa, ya, xb, yb;
+
+ xa = x0;
+ xb = x1;
+ ya = y0;
+ yb = y1;
+
+ c->user_to_device (xa, ya);
+ c->user_to_device (xb, yb);
+
+ return Rect (xa, ya, xb, yb);
+}
+
+
+Rect
+Rect::convert_to_user (Cairo::RefPtr<Cairo::Context> c) const
+{
+ Coord xa, ya, xb, yb;
+
+ xa = x0;
+ xb = x1;
+ ya = y0;
+ yb = y1;
+
+ c->device_to_user (xa, ya);
+ c->device_to_user (xb, yb);
+
+ return Rect (xa, ya, xb, yb);
+}
+
Duple
ArdourCanvas::operator- (Duple const & o)
{