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>
|
/// <param name="matrix"></param>
|
||||||
public override void Transform(Matrix matrix) {
|
public override void Transform(Matrix matrix) {
|
||||||
Rectangle rect = GuiRectangle.GetGuiRectangle(Left, Top, Width, Height);
|
Rectangle rect = GuiRectangle.GetGuiRectangle(Left, Top, Width, Height);
|
||||||
int widthBefore = rect.Width;
|
int pixelsBefore = rect.Width * rect.Height;
|
||||||
int heightBefore = rect.Height;
|
|
||||||
|
|
||||||
// Transform this container
|
// Transform this container
|
||||||
base.Transform(matrix);
|
base.Transform(matrix);
|
||||||
rect = GuiRectangle.GetGuiRectangle(Left, Top, Width, Height);
|
rect = GuiRectangle.GetGuiRectangle(Left, Top, Width, Height);
|
||||||
|
|
||||||
int widthAfter = rect.Width;
|
int pixelsAfter = rect.Width * rect.Height;
|
||||||
int heightAfter = rect.Height;
|
float factor = pixelsAfter / pixelsBefore;
|
||||||
float factor = (((float)widthAfter / widthBefore) + ((float)heightAfter / heightBefore)) / 2;
|
|
||||||
|
|
||||||
float fontSize = GetFieldValueAsFloat(FieldType.FONT_SIZE);
|
float fontSize = GetFieldValueAsFloat(FieldType.FONT_SIZE);
|
||||||
fontSize *= factor;
|
fontSize *= factor;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue