From b0c790c69133ceafadd8374497866e28580422c4 Mon Sep 17 00:00:00 2001
From: Huw Davies <huw@codeweavers.com>
Date: Tue, 11 Nov 2003 00:27:48 +0000
Subject: [PATCH] Only reselect the font if the transformation has actually
 changed.

---
 objects/dc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/objects/dc.c b/objects/dc.c
index eb6d522b411..18668459c48 100644
--- a/objects/dc.c
+++ b/objects/dc.c
@@ -242,7 +242,7 @@ static BOOL DC_InvertXform( const XFORM *xformSrc, XFORM *xformDest )
  */
 void DC_UpdateXforms( DC *dc )
 {
-    XFORM xformWnd2Vport;
+    XFORM xformWnd2Vport, oldworld2vport;
     FLOAT scaleX, scaleY;
 
     /* Construct a transformation to do the window-to-viewport conversion */
@@ -257,6 +257,7 @@ void DC_UpdateXforms( DC *dc )
     xformWnd2Vport.eDy  = (FLOAT)dc->vportOrgY -
         scaleY * (FLOAT)dc->wndOrgY;
 
+    oldworld2vport = dc->xformWorld2Vport;
     /* Combine with the world transformation */
     CombineTransform( &dc->xformWorld2Vport, &dc->xformWorld2Wnd,
         &xformWnd2Vport );
@@ -267,7 +268,8 @@ void DC_UpdateXforms( DC *dc )
 
     /* Reselect the font back into the dc so that the font size
        gets updated. */
-    SelectObject(dc->hSelf, GetCurrentObject(dc->hSelf, OBJ_FONT));
+    if(memcmp(&oldworld2vport, &dc->xformWorld2Vport, sizeof(oldworld2vport)))
+        SelectObject(dc->hSelf, GetCurrentObject(dc->hSelf, OBJ_FONT));
 }
 
 
-- 
GitLab