Jeffrey Smith (@whydoubt) commented about dlls/gdiplus/graphics.c:
else{ /* Get an estimate for the amount the pen width is affected by the world * transform. (This is similar to what some of the wine drivers do.) */ - pt[0].X = 0.0; - pt[0].Y = 0.0; - pt[1].X = 1.0; - pt[1].Y = 1.0; - GdipTransformMatrixPoints(&graphics->worldtrans, pt, 2); + pt[0].X = graphics->worldtrans.matrix[4]; + pt[0].Y = graphics->worldtrans.matrix[5]; + pt[1].X = graphics->worldtrans.matrix[4] + graphics->worldtrans.matrix[0] + graphics->worldtrans.matrix[2]; + pt[1].Y = graphics->worldtrans.matrix[5] + graphics->worldtrans.matrix[1] + graphics->worldtrans.matrix[3]; + width = sqrt((pt[1].X - pt[0].X) * (pt[1].X - pt[0].X) + (pt[1].Y - pt[0].Y) * (pt[1].Y - pt[0].Y)) / sqrt(2.0);
If going for optimization, might as well go the rest of the way cleaning this up. ```suggestion:-6+0 pt[1].X = graphics->worldtrans.matrix[0] + graphics->worldtrans.matrix[2]; pt[1].Y = graphics->worldtrans.matrix[1] + graphics->worldtrans.matrix[3]; width = sqrt(pt[1].X * pt[1].X + pt[1].Y * pt[1].Y) / sqrt(2.0); ``` Note: the compiler converts `sqrt(2.0)` to the actual value, so no need move stuff around to avoid a `sqrt` here. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3971#note_47094