Class ImageTransformHandler
- Namespace
- WitShells.CanvasDrawTool
Handles transform operations (move, scale, rotate) for imported images. Maintains aspect ratio during scaling. Provides visual handles at corners and edges.
public class ImageTransformHandler : MonoBehaviour
- Inheritance
-
ImageTransformHandler
Properties
IsSelected
public bool IsSelected { get; }
Property Value
MaintainAspectRatio
public bool MaintainAspectRatio { get; set; }
Property Value
TargetLayer
public LayerObject TargetLayer { get; }
Property Value
Methods
AttachTo(LayerObject, Canvas)
Attach this handler to a LayerObject.
public void AttachTo(LayerObject layer, Canvas canvas)
Parameters
layerLayerObjectcanvasCanvas
Deselect()
Deselect and hide handles.
public void Deselect()
Dispose()
Clean up handles.
public void Dispose()
FitToCanvas(RectTransform)
Fit to canvas while maintaining aspect ratio.
public void FitToCanvas(RectTransform canvasBounds)
Parameters
canvasBoundsRectTransform
ResetToOriginalSize()
Reset to original size (1:1 with imported image).
public void ResetToOriginalSize()
Select()
Select this layer for transform operations.
public void Select()
ToggleSelection()
Toggle selection state.
public void ToggleSelection()
UpdateHandlePositions()
Update handle positions to match target.
public void UpdateHandlePositions()
Events
OnSelectionChanged
public event Action OnSelectionChanged
Event Type
OnTransformChanged
public event Action OnTransformChanged
Event Type
OnTransformEnded
public event Action OnTransformEnded
Event Type
OnTransformStarted
public event Action OnTransformStarted