mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Stay zoomed when image doesn't fit in client area
This commit is contained in:
parent
992e462383
commit
778eec1188
1 changed files with 8 additions and 8 deletions
|
@ -791,15 +791,15 @@ protected override void OnPaint(PaintEventArgs e)
|
|||
|
||||
Graphics g = e.Graphics;
|
||||
|
||||
g.PixelOffsetMode = PixelOffsetMode.HighSpeed;
|
||||
g.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
|
||||
if (IsEditorMode && !CanvasRectangle.Contains(ClientArea))
|
||||
if (IsEditorMode)
|
||||
{
|
||||
g.ScaleTransform(ZoomFactor, ZoomFactor);
|
||||
if (!CanvasRectangle.Contains(ClientArea))
|
||||
{
|
||||
g.Clear(canvasBackgroundColor);
|
||||
g.DrawRectangleProper(canvasBorderPen, CanvasRectangle.Offset(1));
|
||||
}
|
||||
}
|
||||
|
||||
DrawBackground(g);
|
||||
DrawShapes(g);
|
||||
|
@ -820,8 +820,8 @@ protected override void OnPaint(PaintEventArgs e)
|
|||
|
||||
private void DrawBackground(Graphics g)
|
||||
{
|
||||
// TODO: dynamically adjust scaling quality when zoom != 1 based on FPS
|
||||
// Quality is more important when scaling down than up.
|
||||
// TODO: dynamically improved scaling quality when zoom != 1 if FPS is high
|
||||
// especially when scaling down
|
||||
g.PixelOffsetMode = PixelOffsetMode.HighSpeed;
|
||||
g.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
g.SmoothingMode = SmoothingMode.HighSpeed;
|
||||
|
|
Loading…
Reference in a new issue