[Qt] Added viewport mode
Qt Quick requires third-party rendering codes to follow its standards with regards to viewport transform. Qt 5.6 adds a 'mirrorVertically' property but that only solves the solution for that version of Qt onwards. Telling Mapbox GL core to flip the Y axis makes QQuickMapboxGL item available for Qt 5.2 onwards. Qt 'mirrorVertically' property documentation: http://doc.qt.io/qt-5/qquickframebufferobject.html#mirrorVertically-prop Fixes #4866.
This commit is contained in:
@@ -14,10 +14,6 @@
|
||||
QQuickMapboxGL::QQuickMapboxGL(QQuickItem *parent_)
|
||||
: QQuickFramebufferObject(parent_)
|
||||
{
|
||||
#if QT_VERSION >= 0x050600
|
||||
// FIXME: https://github.com/mapbox/mapbox-gl-native/issues/4866
|
||||
setMirrorVertically(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
QQuickMapboxGL::~QQuickMapboxGL()
|
||||
@@ -166,7 +162,7 @@ QColor QQuickMapboxGL::color() const
|
||||
|
||||
void QQuickMapboxGL::pan(int dx, int dy)
|
||||
{
|
||||
m_pan += QPointF(dx, dy);
|
||||
m_pan += QPointF(dx, -dy);
|
||||
|
||||
m_syncState |= PanNeedsSync;
|
||||
update();
|
||||
|
||||
Reference in New Issue
Block a user