From a4655126c91d22f8241d53e052bc975b8145ff28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 26 Feb 2014 10:10:12 +0100 Subject: [PATCH] app_server: Fix applying current scale when font changes. * The code path actually used when the client uses BView::SetFont() is DrawState::ReadFontFromLink(), where it forgot to a) adopt the original font size in fUnscaledFontSize and b) scale the font by the current combined scale. Fixes remaining part of #10578. --- src/servers/app/DrawState.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/servers/app/DrawState.cpp b/src/servers/app/DrawState.cpp index 3b0f3ef370..c5b5ca3916 100644 --- a/src/servers/app/DrawState.cpp +++ b/src/servers/app/DrawState.cpp @@ -155,7 +155,8 @@ DrawState::ReadFontFromLink(BPrivate::LinkReceiver& link) if ((mask & B_FONT_SIZE) != 0) { float size; link.Read(&size); - fFont.SetSize(size); + fUnscaledFontSize = size; + fFont.SetSize(fUnscaledFontSize * fCombinedScale); } if ((mask & B_FONT_SHEAR) != 0) { @@ -184,7 +185,7 @@ DrawState::ReadFontFromLink(BPrivate::LinkReceiver& link) if ((mask & B_FONT_ENCODING) != 0) { uint8 encoding; - link.Read((uint8*)&encoding); + link.Read(&encoding); fFont.SetEncoding(encoding); }