mirror of
https://github.com/greenshot/greenshot
synced 2025-08-22 22:34:27 -07:00
Fix boxes and circles drawing.
This commit is contained in:
parent
c1e9c72968
commit
5e0cb799bd
1 changed files with 12 additions and 9 deletions
|
@ -30,7 +30,6 @@ namespace Greenshot.Gfx.Legacy
|
|||
/// </summary>
|
||||
public static partial class ScaleHelper
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// calculates the Size an element must be resized to, in order to fit another element, keeping aspect ratio
|
||||
/// </summary>
|
||||
|
@ -377,12 +376,16 @@ namespace Greenshot.Gfx.Legacy
|
|||
|
||||
boundsAfterResize = boundsAfterResize.Resize((float)Math.Round(dist * Math.Cos(angle / 180 * Math.PI)), (float)Math.Round(dist * Math.Sin(angle / 180 * Math.PI)));
|
||||
}
|
||||
else
|
||||
{
|
||||
boundsAfterResize = boundsAfterResize.Resize(cursorX - boundsBeforeResize.Left, cursorY - boundsBeforeResize.Top);
|
||||
}
|
||||
|
||||
if (centeredScale)
|
||||
{
|
||||
var wdiff = boundsAfterResize.Width - boundsBeforeResize.Width;
|
||||
var hdiff = boundsAfterResize.Height - boundsBeforeResize.Height;
|
||||
boundsAfterResize = boundsAfterResize.Offset(-wdiff, -hdiff).Resize(boundsAfterResize.Width + wdiff, boundsAfterResize.Height + hdiff);
|
||||
boundsAfterResize = boundsAfterResize.Offset(-wdiff, -hdiff).Resize(boundsAfterResize.Width + wdiff, boundsAfterResize.Height + hdiff);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue