mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
Removed some unused code, and fixed a Editor-reuse issue. (No focus, and resize issues)
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2106 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
336518f5f9
commit
f7782299cd
7 changed files with 105 additions and 96 deletions
|
@ -295,7 +295,8 @@ namespace GreenshotPlugin.Core {
|
|||
// Change mouse location according to the cropRegtangle (including screenbounds) offset
|
||||
MoveMouseLocation(-cropRectangle.Location.X, -cropRectangle.Location.Y);
|
||||
// Move all the elements
|
||||
MoveElements(-cropRectangle.Location.X, -cropRectangle.Location.Y);
|
||||
// TODO: Enable when the elements are usable again.
|
||||
// MoveElements(-cropRectangle.Location.X, -cropRectangle.Location.Y);
|
||||
|
||||
// Remove invisible elements
|
||||
List <ICaptureElement> newElements = new List<ICaptureElement>();
|
||||
|
@ -320,53 +321,54 @@ namespace GreenshotPlugin.Core {
|
|||
public void MoveMouseLocation(int x, int y) {
|
||||
cursorLocation.Offset(x, y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply a translate to the elements
|
||||
/// e.g. needed for crop
|
||||
/// </summary>
|
||||
/// <param name="x">x coordinates to move the elements</param>
|
||||
/// <param name="y">y coordinates to move the elements</param>
|
||||
public void MoveElements(int x, int y) {
|
||||
MoveElements(elements, x, y);
|
||||
}
|
||||
|
||||
private void MoveElements(List<ICaptureElement> listOfElements, int x, int y) {
|
||||
foreach(ICaptureElement childElement in listOfElements) {
|
||||
Rectangle bounds = childElement.Bounds;
|
||||
bounds.Offset(x, y);
|
||||
childElement.Bounds = bounds;
|
||||
MoveElements(childElement.Children, x, y);
|
||||
}
|
||||
}
|
||||
// TODO: Enable when the elements are usable again.
|
||||
///// <summary>
|
||||
///// Apply a translate to the elements
|
||||
///// e.g. needed for crop
|
||||
///// </summary>
|
||||
///// <param name="x">x coordinates to move the elements</param>
|
||||
///// <param name="y">y coordinates to move the elements</param>
|
||||
//public void MoveElements(int x, int y) {
|
||||
// MoveElements(elements, x, y);
|
||||
//}
|
||||
|
||||
//private void MoveElements(List<ICaptureElement> listOfElements, int x, int y) {
|
||||
// foreach(ICaptureElement childElement in listOfElements) {
|
||||
// Rectangle bounds = childElement.Bounds;
|
||||
// bounds.Offset(x, y);
|
||||
// childElement.Bounds = bounds;
|
||||
// MoveElements(childElement.Children, x, y);
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Add a new element to the capture
|
||||
/// </summary>
|
||||
/// <param name="element">CaptureElement</param>
|
||||
public void AddElement(ICaptureElement element) {
|
||||
int match = elements.IndexOf(element);
|
||||
if (match >= 0) {
|
||||
if (elements[match].Children.Count < element.Children.Count) {
|
||||
elements.RemoveAt(match);
|
||||
elements.Add(element);
|
||||
}
|
||||
} else {
|
||||
elements.Add(element);
|
||||
}
|
||||
}
|
||||
///// <summary>
|
||||
///// Add a new element to the capture
|
||||
///// </summary>
|
||||
///// <param name="element">CaptureElement</param>
|
||||
//public void AddElement(ICaptureElement element) {
|
||||
// int match = elements.IndexOf(element);
|
||||
// if (match >= 0) {
|
||||
// if (elements[match].Children.Count < element.Children.Count) {
|
||||
// elements.RemoveAt(match);
|
||||
// elements.Add(element);
|
||||
// }
|
||||
// } else {
|
||||
// elements.Add(element);
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of rectangles which represent object that are on the capture
|
||||
/// </summary>
|
||||
public List<ICaptureElement> Elements {
|
||||
get {
|
||||
return elements;
|
||||
}
|
||||
set {
|
||||
elements = value;
|
||||
}
|
||||
}
|
||||
///// <summary>
|
||||
///// Returns a list of rectangles which represent object that are on the capture
|
||||
///// </summary>
|
||||
//public List<ICaptureElement> Elements {
|
||||
// get {
|
||||
// return elements;
|
||||
// }
|
||||
// set {
|
||||
// elements = value;
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue