diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-17 15:20:04 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-09-17 15:20:04 -0500 |
commit | 5fa60a7abaa72ba95b90a4587476b940e764d889 (patch) | |
tree | 3182494ebc8885e168822219f1a9a803de7faf4a /tdegtk | |
parent | e9fa6f1ca5a2fcb793d1a0f0d50c87be200b6f9a (diff) | |
download | gtk3-tqt-engine-5fa60a7abaa72ba95b90a4587476b940e764d889.tar.gz gtk3-tqt-engine-5fa60a7abaa72ba95b90a4587476b940e764d889.zip |
Add world matrix stack
Diffstat (limited to 'tdegtk')
-rw-r--r-- | tdegtk/tqtcairopainter.cpp | 26 | ||||
-rw-r--r-- | tdegtk/tqtcairopainter.h | 5 |
2 files changed, 25 insertions, 6 deletions
diff --git a/tdegtk/tqtcairopainter.cpp b/tdegtk/tqtcairopainter.cpp index 75d1b99..0e8da20 100644 --- a/tdegtk/tqtcairopainter.cpp +++ b/tdegtk/tqtcairopainter.cpp @@ -847,6 +847,7 @@ TQt3CairoPaintDevice::TQt3CairoPaintDevice( cairo_surface_t *cairosurface ) : TQPaintDevice( TQInternal::Picture | TQInternal::ExternalDevice ), m_intermediateSurface(NULL), m_painter(NULL), m_devicePainter(NULL) { m_surface = cairosurface; + m_worldMatrixStack.setAutoDelete(TRUE); } /*! @@ -1174,6 +1175,7 @@ bool TQt3CairoPaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p ) setCairoTransformations(); m_clipRegion = TQImage(); m_clipRegionEnabled = false; + m_worldMatrixStack.clear(); } break; case PdcEnd: @@ -1386,16 +1388,28 @@ bool TQt3CairoPaintDevice::cmd( int c, TQPainter *pt, TQPDevCmdParam *p ) } } break; -#if 0 -#ifndef QT_NO_TRANSFORMATIONS case PdcSaveWMatrix: - painter->saveWorldMatrix(); + if (p) { + const TQWMatrix* tqt3matrix = p[0].matrix; + m_worldMatrixStack.push(new TQWMatrix(*tqt3matrix)); + } break; case PdcRestoreWMatrix: - painter->restoreWorldMatrix(); + if (p) { + if (!m_worldMatrixStack.isEmpty()) { + TQWMatrix* matrix = m_worldMatrixStack.pop(); + + // Set world matrix + TQPDevCmdParam param[2]; + int command = PdcSetWMatrix; + param[0].matrix = matrix; + param[1].ival = 0; + cmd(command, pt, param); + + delete matrix; + } + } break; -#endif -#endif case PdcSetClip: if ((p) && (m_painter)) { m_clipRegionEnabled = p[0].ival; diff --git a/tdegtk/tqtcairopainter.h b/tdegtk/tqtcairopainter.h index 9332128..d04e9a4 100644 --- a/tdegtk/tqtcairopainter.h +++ b/tdegtk/tqtcairopainter.h @@ -29,11 +29,14 @@ #include "ntqbrush.h" #include "ntqfont.h" #include "ntqimage.h" +#include "ntqptrstack.h" #include "ntqpainter.h" #include <cairo.h> #include <pango/pangocairo.h> +typedef TQPtrStack<TQWMatrix> TQWMatrixStack; + class Q_EXPORT TQt3CairoPaintDevice : public TQPaintDevice // picture class { public: @@ -85,6 +88,8 @@ class Q_EXPORT TQt3CairoPaintDevice : public TQPaintDevice // picture class TQFont m_font; TQImage m_clipRegion; bool m_clipRegionEnabled; + + TQWMatrixStack m_worldMatrixStack; }; #endif // TDEQT4PAINTER_H |