Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(elementTools.Control): add UI event to setPosition() and resetPosition() signature #2742

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

kumilingus
Copy link
Contributor

Description

The current signature:

abstract class Control extends dia.ToolView {
    protected getPosition(view: dia.ElementView): dia.Point;
    protected setPosition(view: dia.ElementView, coordinates: g.Point): void;
    protected resetPosition(view: dia.ElementView): void;
}

Is changed to:

abstract class Control extends dia.ToolView {
    protected getPosition(view: dia.ElementView): dia.Point;
    protected setPosition(view: dia.ElementView, coordinates: g.Point, evt: dia.Event): void;
    protected resetPosition(view: dia.ElementView, evt: dia.Event): void;
}

This allows anyone to modify the behavior of the control tool based on a UI event.
e.g. disable the resize tool from snapping to the grid when the user holds down the Shift key.

@kumilingus kumilingus changed the title feat(elementTools.Control): add pointer event to setPosition() and resetPosition() signature feat(elementTools.Control): add UI event to setPosition() and resetPosition() signature Aug 21, 2024
@Geliogabalus Geliogabalus merged commit dd0db32 into clientIO:master Aug 26, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants