Feature Request : Add Rotation Handle for Text Items
Is your feature request related to a problem? Please describe.
- Currently, text items on the canvas can only be moved and resized by changing font size. Users cannot rotate text items to achieve different orientations, which is a standard feature in modern text editors like Google Docs, Microsoft Word, and Canva. This limitation restricts creative freedom and makes it difficult to create visually appealing designs that require angled text.
Describe the solution you'd like Add a rotation handle to text items that allows users to:
- Rotate text items by dragging a circular handle
- Display the current rotation angle while rotating
- Snap to common angles (0°, 45°, 90°, 135°, 180°, etc.) when close to them
- Store rotation state persistently when saving pages
- Support rotation in both drawing and text editing modes
Approach to be followed (optional)
- Update TextItemModel
lib/models/text_item_model.dart:
- Add rotation property (in radians or degrees)
- Update toJson() and fromJson() methods
- Update CanvasState
lib/cubit/canvas_state.dart:
- Ensure rotation is preserved in state
- Update CanvasCubit
lib/cubit/canvas_cubit.dart:
- Add rotateText(int index, double angle) method
- Ensure rotation is saved/loaded with pages
- Update _DraggableText Widget
lib/ui/screens/canvas_screen.dart:
- Wrap text with Transform.rotate()
- Add rotation handle widget (small circle icon at corner)
- Implement gesture detection for rotation handle
- Calculate rotation angle based on drag vector from center
- Add visual feedback during rotation (show angle overlay)
- UI Considerations:
- Position rotation handle at top-right corner of text bounding box
- Use a circular icon (🔄) or custom painter for the handle
- Show rotation angle tooltip during rotation
- Implement snap-to-angle feature (±5° tolerance)
Additional context Reference implementations:
- Canva's rotation handle system
- Google Docs rotation for images/text boxes
- Figma's rotation handle
Thank you for opening this issue! 🚀 Our team will review it soon. Please make sure you've included all relevant details and followed our Contributing Guidelines. For questions about our project, check out our README and Code of Conduct.
Please assign me this issue.
@ayn-aval assigned.
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the main branch has fixed it and report again or close the issue.