FlowGraph v0.6.0 - Type-Safe Coordinate System
Type-Safe Coordinate System
A comprehensive refactor to prevent coordinate space confusion at compile time.
New Features
-
Typed Coordinate Types - New types in FlowGraph.Core.Coordinates:
- CanvasPoint, CanvasVector, CanvasRect - Canvas/graph space coordinates
- ViewportPoint, ViewportVector, ViewportRect - Screen/viewport space coordinates
- These prevent accidental mixing of coordinate spaces at compile time
-
Type-Safe FlowCanvas API:
- GetTypedCanvasPosition(e) → Returns CanvasPoint
- GetTypedViewportPosition(e) → Returns ViewportPoint
- Use these for extension/Pro code that needs pointer coordinates
-
Mode-Agnostic Input System - All input states now work correctly in both Visual Tree and Direct Rendering modes without special-case handling
Deprecated APIs
The following methods are deprecated and will be removed in a future version:
- FlowCanvas.GetCanvasPosition(e) → Use GetTypedCanvasPosition(e)
- FlowCanvas.GetViewportPosition(e) → Use GetTypedViewportPosition(e)
- ViewportState.ScreenToCanvas() → Use ViewportState.ViewportToCanvas()
- ViewportState.CanvasToScreen() → Use ViewportState.CanvasToViewport()
Internal Improvements
- All input states (DraggingState, ConnectingState, BoxSelectingState, etc.) migrated to typed coordinate system
- IInputCoordinates interface abstracts rendering-mode-specific coordinate conversion
- IRenderTarget interface provides mode-agnostic temporary visual rendering
- Removed debug statements from production code