Bartosz Kosiorek (@gang65) commented about dlls/gdiplus/graphics.c:
pt[0].X = 0.0; pt[0].Y = 0.0; pt[1].X = 1.0; pt[1].Y = 1.0;
We could optimize even more, by calculating only one sqrt, with: ``` scale_x = graphics->worldtrans.matrix[0] + graphics->worldtrans.matrix[2]; scale_y = graphics->worldtrans.matrix[1] + graphics->worldtrans.matrix[3];
width *= units_to_pixels(pen->width, pen->unit == UnitWorld ? graphics->unit : pen->unit, graphics->xres, graphics->printer_display); width *= graphics->scale;
pt[0].X = 0.0; pt[0].Y = 0.0; pt[1].X = scale_x; pt[1].Y = scale_y;
gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceDevice, pt, 2); 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); ```