-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
fix(): fire Poly control events #9504
Conversation
Update index.spec.ts
Build Stats
|
8af3045
to
04046f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ready
[this.objectId] | ||
); | ||
} | ||
|
||
async executeInBrowser<C, R>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to rename this to evaluate
@@ -10,6 +10,9 @@ import type { | |||
TransformActionHandler, | |||
} from '../EventTypeDefs'; | |||
import { getLocalPoint } from './util'; | |||
import { wrapWithFireEvent } from './wrapWithFireEvent'; | |||
|
|||
const ACTION_NAME = 'modifyPoly'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a good name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
viewing this commit by commit might be easier to review
@@ -126,7 +132,7 @@ export function createPolyControls( | |||
idx++ | |||
) { | |||
controls[`p${idx}`] = new Control({ | |||
actionName: 'modifyPoly', | |||
actionName: ACTION_NAME, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we call it modifyPoly?
This is a terrible name.
Shouldn't be this just resizing? or modifying? it doesn't matter for this pr of course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. BAD name. resizing... not percise. modifying too general.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have to write an issue to cover the fact that actionName of wrapWithFireEvent will not be in sync with control.actionName.
Not sure if is worth fixing or just documenting
control.actionName is used for end transform event, while this one is used for in transform event.
The current situation must be at least explained somewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it ought to be the same value. Why else?
Motivation
#9503
PolyControl do not have a wrapWithFireEvent
Description
Fire an event when modifiying a poly via a poly control.
TODO:
wrapWithFireEvent
will fire a staletransform
object on the first call becausetransform.actionPerformed
is not yet set ontransform
but istrue
. It is set afterwrapWithFireEvent
is called. That needs fixing.Changes
wrapWithFireEvent
Gist
In Action