Rework for paste from clipboard

- location is determined by the same code for images and text;
- use visible area to determine the location.
This commit is contained in:
Killy 2020-04-27 19:15:08 +03:00
parent 3d39241f82
commit 169dbdccec
4 changed files with 93 additions and 50 deletions

View file

@ -84,8 +84,8 @@ namespace GreenshotPlugin.Interfaces
/// The TextContainer will be "re"sized to the text size.
/// </summary>
/// <param name="text">String to show</param>
/// <param name="horizontalAlignment">Left, Center, Right</param>
/// <param name="verticalAlignment">TOP, CENTER, BOTTOM</param>
/// <param name="x">Where to put the container, X coordinate in the Image coordinate space</param>
/// <param name="y">Where to put the container, Y coordinate in the Image coordinate space</param>
/// <param name="family">FontFamily</param>
/// <param name="size">Font Size in float</param>
/// <param name="italic">bool true if italic</param>
@ -94,7 +94,7 @@ namespace GreenshotPlugin.Interfaces
/// <param name="borderSize">size of border (0 for none)</param>
/// <param name="color">Color of string</param>
/// <param name="fillColor">Color of background (e.g. Color.Transparent)</param>
ITextContainer AddTextContainer(string text, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, FontFamily family, float size, bool italic, bool bold, bool shadow, int borderSize, Color color, Color fillColor);
ITextContainer AddTextContainer(string text, int x, int y, FontFamily family, float size, bool italic, bool bold, bool shadow, int borderSize, Color color, Color fillColor);
IImageContainer AddImageContainer(Image image, int x, int y);
ICursorContainer AddCursorContainer(Cursor cursor, int x, int y);
@ -208,6 +208,16 @@ namespace GreenshotPlugin.Interfaces
/// </summary>
/// <param name="rc">A rectangle in the coordinate space of the image.</param>
Rectangle ToSurfaceCoordinates(Rectangle rc);
/// <summary>
/// Translate a point from surface coorditate space to image coordinate space.
/// </summary>
/// <param name="point">A point in the coordinate space of the surface.</param>
Point ToImageCoordinates(Point point);
/// <summary>
/// Translate a rectangle from surface coorditate space to image coordinate space.
/// </summary>
/// <param name="rc">A rectangle in the coordinate space of the surface.</param>
Rectangle ToImageCoordinates(Rectangle rc);
void MakeUndoable(IMemento memento, bool allowMerge);
}