diff src/graphics.cc @ 7445:af92b34f3a3a

[project @ 2008-02-04 07:53:07 by jwe]
author jwe
date Mon, 04 Feb 2008 07:53:07 +0000
parents 4e3b073e910e
children 4bfbec4b0e24
line wrap: on
line diff
--- a/src/graphics.cc	Mon Feb 04 07:40:55 2008 +0000
+++ b/src/graphics.cc	Mon Feb 04 07:53:07 2008 +0000
@@ -161,6 +161,17 @@
   return m;
 }
 
+static Matrix
+default_figure_position (void)
+{
+  Matrix m (1, 4, 0.0);
+  m(0) = 300;
+  m(1) = 200;
+  m(2) = 560;
+  m(3) = 420;
+  return m;
+}
+
 // NOTE: "cb" is passed by value, because "function_value" method
 //       is non-const; passing "cb" by const-reference is not
 //       possible
@@ -1318,6 +1329,9 @@
 
   double get_screen_resolution (void) const
     { return 72.0; }
+
+  Matrix get_screen_size (void) const
+    { return Matrix (1, 2, 0.0); }
 };
 
 graphics_backend
@@ -1404,6 +1418,23 @@
     }
 }
 
+Matrix
+figure::properties::get_boundingbox (void) const
+{
+  graphics_backend b = get_backend ();
+  // FIXME: screen size should be obtained from root object
+  Matrix screen_size = b.get_screen_size ();
+  Matrix pos;
+
+  pos = convert_position (get_position ().matrix_value (), get_units (),
+			  "pixels", screen_size, b);
+
+  pos(0)--;
+  pos(1)--;
+
+  return pos;
+}
+
 octave_value
 figure::get_default (const caseless_str& name) const
 {