Skip to content

Commit c79df3c

Browse files
fix: clamp GDI char dimensions in Store_GDI_Char
1 parent 27da5b8 commit c79df3c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,8 @@ FontCharsClass::Store_GDI_Char (WCHAR ch)
13431343
SIZE char_size = { 0 };
13441344
::GetTextExtentPoint32W( MemDC, &ch, 1, &char_size );
13451345
char_size.cx += PixelOverlap + xOrigin;
1346+
char_size.cx = min((int)char_size.cx, width);
1347+
char_size.cy = CharHeight;
13461348
//
13471349
// Get a pointer to the surface that this character should use
13481350
//

0 commit comments

Comments
 (0)