Commit 22ebc746 authored by Don Gagne's avatar Don Gagne

QImage creations fails causing QPainter to fail

Need to check for QImage failure otherwise it will through a qWarning.
parent 5221c66e
...@@ -133,13 +133,15 @@ namespace mapcontrol ...@@ -133,13 +133,15 @@ namespace mapcontrol
temp=QImage(size, temp=QImage(size,
QImage::Format_ARGB32_Premultiplied); QImage::Format_ARGB32_Premultiplied);
temp.fill(0); temp.fill(0);
QPainter imagePainter(&temp); if (!temp.isNull()) {
imagePainter.translate(-boundingRect().topLeft()); QPainter imagePainter(&temp);
imagePainter.scale(2*zoomdiff,2*zoomdiff); imagePainter.translate(-boundingRect().topLeft());
paintImage(&imagePainter); imagePainter.scale(2*zoomdiff,2*zoomdiff);
imagePainter.end(); paintImage(&imagePainter);
lastimagepoint=Point(core->GetrenderOffset().X()*2*zoomdiff,core->GetrenderOffset().Y()*2*zoomdiff); imagePainter.end();
lastimage=temp; lastimagepoint=Point(core->GetrenderOffset().X()*2*zoomdiff,core->GetrenderOffset().Y()*2*zoomdiff);
lastimage=temp;
}
} }
void MapGraphicItem::paintImage(QPainter *painter) void MapGraphicItem::paintImage(QPainter *painter)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment