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

fix(Object): Fixes centeredScaling prop type #9401

Merged
merged 5 commits into from
Oct 7, 2023

Conversation

HesamSoleymani
Copy link
Contributor

Motivation

centeredScaling type is set to "false" instead of "boolean" in v6
As @ShaMan123 mentioned in this discussion, it looks like a mistake...

Description

  /**
   * When true, this object will use center point as the origin of transformation
   * when being scaled via the controls.
   * <b>Backwards incompatibility note:</b> This property replaces "centerTransform" (Boolean).
   * @since 1.3.4
   * @type Boolean
   * @default
   */
  centeredScaling: false;

Changes

I've just changed centeredScaling type in FabricObjectProps.ts

Copy link
Contributor

@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.

thanks, could it be that it is optional as well?

@@ -28,7 +28,7 @@ export interface FabricObjectProps
* @type Boolean
* @default
*/
centeredScaling: false;
centeredScaling: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
centeredScaling: boolean;
centeredScaling?: boolean;

??

Copy link
Contributor Author

@HesamSoleymani HesamSoleymani Oct 5, 2023

Choose a reason for hiding this comment

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

Is it necessary? I mean I think Partial<FabricObjectProps> is being used everywhere so every option is optional...
But if it is necessary, then what about other props which are still not optional in FabricObjectProps ? (such as centeredRotation, selectionBackgroundColor, selectable and ...)

Copy link
Contributor

Choose a reason for hiding this comment

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

I will give a look and follow up if needed

@ShaMan123
Copy link
Contributor

Can you add a log to the changlog?
Then I can merge

Copy link
Member

@asturur asturur left a comment

Choose a reason for hiding this comment

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

@HesamSoleymani
Copy link
Contributor Author

Everything is ok now about this pr?

asturur
asturur previously approved these changes Oct 6, 2023
@asturur
Copy link
Member

asturur commented Oct 6, 2023

i think so.
@ShaMan123 wanted to have a look at something, i approved, when he has time he can check and merge or comment.

@ShaMan123 ShaMan123 merged commit 10dd84d into fabricjs:master Oct 7, 2023
20 of 22 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.

3 participants