mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
fixes to drawing code
git-svn-id: http://svn.osgeo.org/qgis/trunk@46 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
c94a18c603
commit
4983e92aae
@ -1,3 +1,6 @@
|
||||
July 26, 2002
|
||||
Drawing code now properly displays layers and calculates extents when
|
||||
zooming. Zoom is still fixed zoom in rather than interactive.
|
||||
July 20, 2002
|
||||
Repaint automatic for layers.
|
||||
July 18, 2002
|
||||
|
@ -268,5 +268,5 @@ QgisApp::drawPoint (double x, double y)
|
||||
|
||||
void QgisApp::drawLayers(){
|
||||
cout << "In QgisApp::drawLayers()" << endl;
|
||||
mapCanvas->render();
|
||||
mapCanvas->render2();
|
||||
}
|
||||
|
@ -56,14 +56,16 @@ void QgsMapCanvas::render2(){
|
||||
cout << "MuppX is: " << muppX << "\nMuppY is: " << muppY << endl;
|
||||
m_mupp = muppY > muppX?muppY:muppX;
|
||||
// calculate the actual extent of the mapCanvas
|
||||
double dxmin,dymin,dymax,whitespace;
|
||||
double dxmin,dxmax,dymin,dymax,whitespace;
|
||||
if(muppY > muppX){
|
||||
dymin = currentExtent.yMin();
|
||||
dymax = currentExtent.yMax();
|
||||
whitespace = ((width() *m_mupp) - currentExtent.width())/2;
|
||||
dxmin = currentExtent.xMin() - whitespace;
|
||||
dxmax = currentExtent.xMax() + whitespace;
|
||||
}else{
|
||||
dxmin = currentExtent.xMin();
|
||||
dxmax = currentExtent.xMax();
|
||||
whitespace = ((height() *m_mupp) - currentExtent.height())/2;
|
||||
dymin = currentExtent.yMin() - whitespace;
|
||||
dymax = currentExtent.yMax() + whitespace;
|
||||
@ -71,6 +73,11 @@ void QgsMapCanvas::render2(){
|
||||
}
|
||||
cout << "dxmin: " << dxmin << endl << "dymin: " << dymin << endl << "dymax: " << dymax << endl << "whitespace: " << whitespace << endl;
|
||||
coordXForm->setParameters(m_mupp, dxmin,dymin,height()); //currentExtent.xMin(), currentExtent.yMin(), currentExtent.yMax());
|
||||
// update the currentExtent to match the device coordinates
|
||||
currentExtent.setXmin(dxmin);
|
||||
currentExtent.setXmax(dxmax);
|
||||
currentExtent.setYmin(dymin);
|
||||
currentExtent.setYmax(dymax);
|
||||
// render all layers in the stack, starting at the base
|
||||
map<QString,QgsMapLayer *>::iterator mi = layers.begin();
|
||||
while(mi != layers.end()){
|
||||
|
Loading…
x
Reference in New Issue
Block a user