mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
Improved tared maps scrolling performance
This commit is contained in:
parent
70ddbe192f
commit
b8eede21c0
@ -4,6 +4,7 @@
|
|||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
|
#include <QPixmapCache>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "rd.h"
|
#include "rd.h"
|
||||||
#include "wgs84.h"
|
#include "wgs84.h"
|
||||||
@ -348,8 +349,12 @@ void OziMap::draw(QPainter *painter, const QRectF &rect)
|
|||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
|
|
||||||
if (_tar.isOpen()) {
|
if (_tar.isOpen()) {
|
||||||
QByteArray ba = _tar.file(tileName);
|
QString key = _tar.fileName() + "/" + tileName;
|
||||||
pixmap = QPixmap::fromImage(QImage::fromData(ba));
|
if (!QPixmapCache::find(key, &pixmap)) {
|
||||||
|
QByteArray ba = _tar.file(tileName);
|
||||||
|
pixmap = QPixmap::fromImage(QImage::fromData(ba));
|
||||||
|
QPixmapCache::insert(key, pixmap);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
pixmap = QPixmap(tileName);
|
pixmap = QPixmap(tileName);
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ public:
|
|||||||
QStringList files() const {return _index.keys();}
|
QStringList files() const {return _index.keys();}
|
||||||
QByteArray file(const QString &name);
|
QByteArray file(const QString &name);
|
||||||
|
|
||||||
|
QString fileName() const {return _file.fileName();}
|
||||||
bool isOpen() const {return _file.isOpen();}
|
bool isOpen() const {return _file.isOpen();}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user