Code

convert NR to Geom
authorjohanengelen <johanengelen@users.sourceforge.net>
Sun, 28 Dec 2008 21:56:47 +0000 (21:56 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Sun, 28 Dec 2008 21:56:47 +0000 (21:56 +0000)
src/ui/view/edit-widget.cpp

index dd437aad836981a85d6435812d9d82f3cd97453b..5e9b44ff675081d51b1f62c74aad33566cce0574 100644 (file)
@@ -1664,13 +1664,13 @@ EditWidget::onWindowSizeAllocate (Gtk::Allocation &newall)
 void
 EditWidget::onWindowRealize()
 {
-    NR::Rect d( Geom::Point(0, 0),
-                  Geom::Point(sp_document_width(_desktop->doc()), sp_document_height(_desktop->doc())) );
-
-    if (d.isEmpty(1.0)) {
+    if ( (sp_document_width(_desktop->doc()) < 1.0) || (sp_document_height(_desktop->doc()) < 1.0) ) {
         return;
     }
 
+    Geom::Rect d( Geom::Point(0, 0),
+                  Geom::Point(sp_document_width(_desktop->doc()), sp_document_height(_desktop->doc())) );
+
     _desktop->set_display_area(d.min()[Geom::X], d.min()[Geom::Y], d.max()[Geom::X], d.max()[Geom::Y], 10);
     _namedview_modified(_desktop->namedview, SP_OBJECT_MODIFIED_FLAG);
     setTitle (SP_DOCUMENT_NAME(_desktop->doc()));