From 8212c29df50cbf3922d97dd2f6a8025104efd3b1 Mon Sep 17 00:00:00 2001 From: Dmitry Karasik Date: Sun, 24 Nov 2024 13:11:17 +0100 Subject: [PATCH] fix rotated argb glyphs --- win32/dwfont.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/win32/dwfont.c b/win32/dwfont.c index d1b94dd8..bf62732f 100644 --- a/win32/dwfont.c +++ b/win32/dwfont.c @@ -451,7 +451,7 @@ dwrite_draw_bitmap( Handle self, uint16_t index, Point size, Point aperture ) t.glyphs = &index; t.advances = &dummy_advance; t.positions = dummy_offset; - if ( !( enumerator = get_enumerator(self, sys dc_font, &t, aperture.x, size.y + aperture.y))) + if ( !( enumerator = get_enumerator(self, sys dc_font, &t, 0, 0))) return NULL; l = enumerate_colorrun( enumerator, t.len ); @@ -476,13 +476,15 @@ dwrite_draw_bitmap( Handle self, uint16_t index, Point size, Point aperture ) save_font = SelectObject(dc, sys dc_font->hfont); SetTextAlign( dc, TA_BASELINE); SetBkMode ( dc, TRANSPARENT); - if ( !prima_matrix_is_identity( var current_state.matrix )) { + { Matrix *m = &var current_state.matrix; XFORM xf = { - (*m)[0], -((*m)[1]), - -((*m)[2]), (*m)[3], - 0, 0 + (*m)[0], -(*m)[1], + -(*m)[2], (*m)[3], + -aperture.x, + (size.y + aperture.y) }; + SetGraphicsMode( dc, GM_ADVANCED); SetWorldTransform( dc, &xf ); }