File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -579,6 +579,31 @@ void QgsMapRender::updateFullExtent()
579
579
}
580
580
it++;
581
581
}
582
+
583
+ if (mFullExtent .width () == 0.0 || mFullExtent .height () == 0.0 )
584
+ {
585
+ // If all of the features are at the one point, buffer the
586
+ // rectangle a bit. If they are all at zero, do something a bit
587
+ // more crude.
588
+
589
+ if (mFullExtent .xMin () == 0.0 && mFullExtent .xMax () == 0.0 &&
590
+ mFullExtent .yMin () == 0.0 && mFullExtent .yMax () == 0.0 )
591
+ {
592
+ mFullExtent .set (-1.0 , -1.0 , 1.0 , 1.0 );
593
+ }
594
+ else
595
+ {
596
+ const double padFactor = 1e-8 ;
597
+ double widthPad = mFullExtent .xMin () * padFactor;
598
+ double heightPad = mFullExtent .yMin () * padFactor;
599
+ double xmin = mFullExtent .xMin () - widthPad;
600
+ double xmax = mFullExtent .xMax () + widthPad;
601
+ double ymin = mFullExtent .yMin () - heightPad;
602
+ double ymax = mFullExtent .yMax () + heightPad;
603
+ mFullExtent .set (xmin, ymin, xmax, ymax);
604
+ }
605
+ }
606
+
582
607
QgsDebugMsg (" Full extent: " + mFullExtent .stringRep ());
583
608
}
584
609
You can’t perform that action at this time.
0 commit comments