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(): DrawShape, DrawOval, DrawPoly #8430

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open

feat(): DrawShape, DrawOval, DrawPoly #8430

wants to merge 84 commits into from

Conversation

ShaMan123
Copy link
Contributor

@ShaMan123 ShaMan123 commented Nov 7, 2022

Motivation

We discussed adding a poly brush to core.
I need it for a project so why not. Here it is.

closes #6319

Description

Interaction managers that are in charge of drawing a shape.
I have sticked to brush impl though I don't agree with the event naming and adding the shape to canvas by default. Thought that was best until we refactor all brushes (#8476 ).

Changes

_onDoubleClick calls brush method
Furture PR should make all pointer events funnel through the active brush.

Gist

First merge #8417
closes #8428

DrawShapeBase

base class to shape creation interaction

DrawShape

Simple and good pointer interaction creating a shape

DrawOval

same, extends DrawShape

DrawPoly

  • mouseDown/Up adds a point, dblclick ends interaction

What do you think about naming?

vpt isn't there yet, see videos below, I think this is a bug in canvas vpt when skewing, unrelated to the PR

In Action

fabric.js.sandbox.-.Google.Chrome.2022-11-07.21-18-40.mp4

centered + shiftKey

fabric.js.sandbox.-.Google.Chrome.2022-11-07.21-16-07.mp4

Unrelated and unexpected caching effect at the end

fabric.js.sandbox.-.Google.Chrome.2022-11-07.17-35-34.mp4
fabric.js.sandbox.-.Google.Chrome.2022-11-07.17-37-21.mp4

vpt

fabric.js.sandbox.-.Google.Chrome.2022-11-07.21-21-36.mp4

With vpt + objectCaching
BBox is off!

fabric.js.sandbox.-.Google.Chrome.2022-11-07.17-38-14.mp4

Copy link
Contributor Author

@ShaMan123 ShaMan123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated from master

Copy link
Contributor Author

@ShaMan123 ShaMan123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Contributor Author

@ShaMan123 ShaMan123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated from master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature stale Issue marked as stale by the stale bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Draw polygon by click
1 participant