mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Fix font size changes when rotating the canvas.
This commit is contained in:
parent
100ad04059
commit
740604a2a7
1 changed files with 3 additions and 5 deletions
|
@ -253,16 +253,14 @@ namespace Greenshot.Drawing {
|
|||
/// <param name="matrix"></param>
|
||||
public override void Transform(Matrix matrix) {
|
||||
Rectangle rect = GuiRectangle.GetGuiRectangle(Left, Top, Width, Height);
|
||||
int widthBefore = rect.Width;
|
||||
int heightBefore = rect.Height;
|
||||
int pixelsBefore = rect.Width * rect.Height;
|
||||
|
||||
// Transform this container
|
||||
base.Transform(matrix);
|
||||
rect = GuiRectangle.GetGuiRectangle(Left, Top, Width, Height);
|
||||
|
||||
int widthAfter = rect.Width;
|
||||
int heightAfter = rect.Height;
|
||||
float factor = (((float)widthAfter / widthBefore) + ((float)heightAfter / heightBefore)) / 2;
|
||||
int pixelsAfter = rect.Width * rect.Height;
|
||||
float factor = pixelsAfter / pixelsBefore;
|
||||
|
||||
float fontSize = GetFieldValueAsFloat(FieldType.FONT_SIZE);
|
||||
fontSize *= factor;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue