Conversation
Reviewer's GuideThe PR fixes unintended background movement by importing the LayerInteraction model and configuring the background WidgetLayer to disable all interaction flags, ensuring only foreground elements remain interactive. Sequence Diagram: Handling Background Drag Attempt Post-FixsequenceDiagram
actor User
participant Editor
participant BackgroundWidgetLayer
User->>Editor: Attempts to drag background image
Editor->>BackgroundWidgetLayer: processInteraction(type="drag")
%% BackgroundWidgetLayer now has interaction.enableMove = false
BackgroundWidgetLayer-->>Editor: interactionPrevented(type="drag")
Editor-->>User: Background image remains fixed
Class Diagram: Configuration of WidgetLayer InteractionclassDiagram
class LayerInteraction {
+enableEdit: bool = false
+enableMove: bool = false
+enableRotate: bool = false
+enableScale: bool = false
+enableSelection: bool = false
+LayerInteraction(enableEdit: bool, enableMove: bool, enableRotate: bool, enableScale: bool, enableSelection: bool)
}
class WidgetLayer {
+interaction: LayerInteraction
+offset: Offset
+scale: double
+widget: Image
+WidgetLayer(interaction: LayerInteraction, offset: Offset, scale: double, widget: Image)
}
WidgetLayer "1" *-- "1" LayerInteraction : uses
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @Dhruv1797 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
AsCress
left a comment
There was a problem hiding this comment.
@Dhruv1797 Looks good ! However, could you please add a demo showing what exactly this solves ?
|
this is the previous behaviour where where the background could be unintentionally moved while editing. previous_behaviour.mp4now this is the updated behaviour where background stays fixed, allowing only the foreground elements to be interactive and draggable updated_behaviour.mp4@AsCress please review it. |
AsCress
left a comment
There was a problem hiding this comment.
@Dhruv1797 Thanks for the explanation !
Fixes #33 – Resolved an issue where the background image could be unintentionally moved while editing. The update ensures the background stays fixed, allowing only the foreground elements (like drawings or overlays) to be interactive and draggable.
Summary by Sourcery
Disable all interactive operations on the background layer to prevent unintentional movement and ensure only foreground elements remain draggable.
Bug Fixes:
Enhancements: