summaryrefslogtreecommitdiffstats
path: root/tdegtk/tqtcairopainter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdegtk/tqtcairopainter.cpp')
-rw-r--r--tdegtk/tqtcairopainter.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/tdegtk/tqtcairopainter.cpp b/tdegtk/tqtcairopainter.cpp
index c19a736..6d3b2cf 100644
--- a/tdegtk/tqtcairopainter.cpp
+++ b/tdegtk/tqtcairopainter.cpp
@@ -327,16 +327,16 @@ void TQt3CairoPaintDevice::transferIntermediateSurface() {
if (!m_clipRegionEnabled) {
// Clipping disabled
- cairo_set_source_surface(m_devicePainter, m_intermediateSurface, 0, 0);
+ cairo_set_source_surface(m_devicePainter, m_intermediateSurface, m_offsetX, m_offsetY);
cairo_set_operator(m_devicePainter, overlayMerge?CAIRO_OPERATOR_OVER:CAIRO_OPERATOR_SOURCE);
cairo_paint(m_devicePainter);
}
else {
// Clipping enabled
cairo_surface_t* maskSurface = TQImageToCairoSurface(m_clipRegion);
- cairo_set_source_surface(m_devicePainter, m_intermediateSurface, 0, 0);
+ cairo_set_source_surface(m_devicePainter, m_intermediateSurface, m_offsetX, m_offsetY);
cairo_set_operator(m_devicePainter, overlayMerge?CAIRO_OPERATOR_OVER:CAIRO_OPERATOR_SOURCE);
- cairo_mask_surface(m_devicePainter, maskSurface, 0, 0);
+ cairo_mask_surface(m_devicePainter, maskSurface, m_offsetX, m_offsetY);
cairo_surface_destroy(maskSurface);
}
@@ -1083,16 +1083,18 @@ void TQt3CairoPaintDevice::setCairoTransformations() {
Constructs TQt3CairoPaintDevice on an existing QPainter
*/
-TQt3CairoPaintDevice::TQt3CairoPaintDevice( cairo_surface_t *cairosurface, int width, int height, cairo_t *overridepainter )
+TQt3CairoPaintDevice::TQt3CairoPaintDevice( cairo_surface_t *cairosurface, int x, int y, int width, int height, cairo_t *overridepainter )
: TQPaintDevice( TQInternal::Picture | TQInternal::ExternalDevice )
{
init();
+ m_offsetX = x;
+ m_offsetY = y;
if (width >= 0) {
m_width = width;
}
if (height >= 0) {
- m_height = width;
+ m_height = height;
}
if (overridepainter) {
m_overridePainter = overridepainter;
@@ -1138,6 +1140,8 @@ TQt3CairoPaintDevice::~TQt3CairoPaintDevice()
void TQt3CairoPaintDevice::init() {
m_width = -1;
m_height = -1;
+ m_offsetX = 0;
+ m_offsetY = 0;
m_intermediateSurface = NULL;
m_painter = NULL;