Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Epica3055 committed Sep 5, 2023
1 parent 9932bec commit 6a3790e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal class TableLayoutPanelBehavior : Behavior
private BehaviorService behaviorService; //used for bounds translation
private IServiceProvider serviceProvider; //cached to allow our behavior to get services
private TableLayoutPanelResizeGlyph tableGlyph; //the glyph being resized
private DesignerTransaction resizeTransaction; //used to make size adjustements within transaction
private DesignerTransaction resizeTransaction; //used to make size adjustments within transaction
private PropertyDescriptor resizeProp; //cached property descriptor representing either the row or column styles
private PropertyDescriptor changedProp; //cached property descriptor that refers to the RowSTyles or ColumnStyles collection.
private TableLayoutPanel table;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -918,8 +918,8 @@ public static bool ValidName(string name,

private class ListBoxItem
{
private Type _propertyType;
private string _propertyName;
private readonly Type _propertyType;
private readonly string _propertyName;

public ListBoxItem(Type propertyType, string propertyName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private static InterpolationMode InterpolationMode
}
}

internal static Bitmap ScaleBitmapToSize(Bitmap logicalImage, Size deviceImageSize, bool offset = true)
private static Bitmap ScaleBitmapToSize(Bitmap logicalImage, Size deviceImageSize)
{
Bitmap deviceImage;
deviceImage = new Bitmap(deviceImageSize.Width, deviceImageSize.Height, logicalImage.PixelFormat);
Expand All @@ -156,10 +156,7 @@ internal static Bitmap ScaleBitmapToSize(Bitmap logicalImage, Size deviceImageSi
// and will appear black even if we cleared the background with transparent color.
// The apparition of these artifacts depends on the interpolation mode, on the dpi scaling factor, etc.
// E.g. at 150% DPI, Bicubic produces them and NearestNeighbor is fine, but at 200% DPI NearestNeighbor also shows them.
if (offset)
{
sourceRect.Offset(-0.5f, -0.5f);
}
sourceRect.Offset(-0.5f, -0.5f);

graphics.DrawImage(logicalImage, destRect, sourceRect, GraphicsUnit.Pixel);
}
Expand Down Expand Up @@ -294,14 +291,14 @@ public static Size LogicalToDeviceUnits(Size logicalSize, int deviceDpi = 0)
/// <param name="logicalImage">The image to scale from logical units to device units</param>
/// <param name="targetImageSize">The size to scale image to</param>
[return: NotNullIfNotNull("logicalImage")]
public static Bitmap? CreateResizedBitmap(Bitmap? logicalImage, Size targetImageSize, bool doNotOffset = false)
public static Bitmap? CreateResizedBitmap(Bitmap? logicalImage, Size targetImageSize)
{
if (logicalImage is null)
{
return null;
}

return ScaleBitmapToSize(logicalImage, targetImageSize, doNotOffset);
return ScaleBitmapToSize(logicalImage, targetImageSize);
}

/// <summary>
Expand Down

0 comments on commit 6a3790e

Please sign in to comment.