Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Tue, 01 Jan 2013 17:51:52 UTC
Commit: 1bad1551d7ab0827c3a4d9c08783424003123122
https://github.com/geany/geany/commit/1bad1551d7ab0827c3a4d9c08783424003123…
Log Message:
-----------
Scintilla: 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.
(Applied to Scintilla HG as 74c71632dd1afa726b0f1608d13413e0864da9b0)
Modified Paths:
--------------
scintilla/gtk/PlatGTK.cxx
Modified: scintilla/gtk/PlatGTK.cxx
4 files changed, 4 insertions(+), 0 deletions(-)
===================================================================
@@ -541,6 +541,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;
@@ -554,6 +556,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);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).