diff options
author | Colomban Wendling <ban@herbesfolles.org> | 2013-01-01 18:20:35 +1100 |
---|---|---|
committer | Colomban Wendling <ban@herbesfolles.org> | 2013-01-01 18:20:35 +1100 |
commit | 984ffd40338704db4ef1ce5333e0ed1ec9cd5a71 (patch) | |
tree | 878fa401b76bbb5c4a82b87798141494b1fd4ebb | |
parent | 15fa779b9f0a6e83bb3af2e43574106260e8bf17 (diff) | |
download | scintilla-mirror-984ffd40338704db4ef1ce5333e0ed1ec9cd5a71.tar.gz |
Properly update the Pango contexts for the target surface
This fixes drawing on a surface that has different settings (like
scaling) than the display surface, by performing the measurements on a
layout properly set up for the target surface.
In practice, this fixes e.g. printing on a scaled surface.
---
gtk/PlatGTK.cxx | 4 ++++
1 file changed, 4 insertions(+)
-rw-r--r-- | gtk/PlatGTK.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 3aec7a6ab..beef9749d 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -553,6 +553,8 @@ void SurfaceImpl::Init(SurfaceID sid, WindowID wid) { PLATFORM_ASSERT(wid); context = cairo_reference(reinterpret_cast<cairo_t *>(sid)); pcontext = gtk_widget_create_pango_context(PWidget(wid)); + // update the Pango context in case sid isn't the widget's surface + pango_cairo_update_context(context, pcontext); layout = pango_layout_new(pcontext); cairo_set_line_width(context, 1); createdGC = true; @@ -566,6 +568,8 @@ void SurfaceImpl::InitPixMap(int width, int height, Surface *surface_, WindowID PLATFORM_ASSERT(wid); context = cairo_reference(surfImpl->context); pcontext = gtk_widget_create_pango_context(PWidget(wid)); + // update the Pango context in case surface_ isn't the widget's surface + pango_cairo_update_context(context, pcontext); PLATFORM_ASSERT(pcontext); layout = pango_layout_new(pcontext); PLATFORM_ASSERT(layout); |