From 75ffc4c69ce800b2e3514934b0e0fee6a6cfd1d0 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 16 Feb 2011 23:31:13 +0000 Subject: [PATCH] Applied #11097: wxGraphicsContext::DrawBitmap: x and y coords should not be affected by stretch factor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@66928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/graphicc.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index 585b7d1a36..600116f369 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -1290,15 +1290,14 @@ void wxCairoContext::DrawGraphicsBitmapInternal(const wxGraphicsBitmap &bmp, wxD wxSize size = data->GetSize(); PushState(); + // prepare to draw the image + cairo_translate(m_context, x, y); // In case we're scaling the image by using a width and height different // than the bitmap's size create a pattern transformation on the surface and // draw the transformed pattern. wxDouble scaleX = w / size.GetWidth(); wxDouble scaleY = h / size.GetHeight(); cairo_scale(m_context, scaleX, scaleY); - - // prepare to draw the image - cairo_translate(m_context, x, y); cairo_set_source(m_context, pattern); // use the original size here since the context is scaled already... cairo_rectangle(m_context, 0, 0, size.GetWidth(), size.GetHeight());