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 | 194964071cabae35ee7436cfd9865187166724d9 (patch) | |
| tree | 8871117637da462f41a5ed284dac61b9a8a36a2c | |
| parent | cd64c66c16be907fb0d35ffca3e90208d16ee519 (diff) | |
| download | scintilla-mirror-194964071cabae35ee7436cfd9865187166724d9.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); |
