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

chore(TS) convert more utils #8180

Merged
merged 5 commits into from
Aug 26, 2022
Merged

chore(TS) convert more utils #8180

merged 5 commits into from
Aug 26, 2022

Conversation

asturur
Copy link
Member

@asturur asturur commented Aug 24, 2022

Plain conversion of add/remove transforms to object and make bounding box from points

@@ -33,7 +33,7 @@ type TComposeMatrixArgs = TTranslateMatrixArgs & TRotateMatrixArgs & TScaleMatri
* @param {Boolean} [ignoreOffset] Indicates that the offset should not be applied
* @return {Point} The transformed point
*/
export const transformPoint = (p: Point | IPoint, t: TMat2D, ignoreOffset: boolean): Point => new Point(p).transform(t, ignoreOffset);
export const transformPoint = (p: Point | IPoint, t: TMat2D, ignoreOffset?: boolean): Point => new Point(p).transform(t, ignoreOffset);
Copy link
Contributor

Choose a reason for hiding this comment

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

aren't we moving this to point? same as rotatePoint?

Copy link
Member Author

Choose a reason for hiding this comment

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

is already on point, this is the old util that uses the point method

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry I didn't notice

import { invertTransform, multiplyTransformMatrices, qrDecompose } from "./matrix";
import type { TComposeMatrixArgs } from './matrix';

type FabricObject = any;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should put this in typedefs so it will be easy to replace...
I didn't put too much thought into it when I did it

Copy link
Member Author

Choose a reason for hiding this comment

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

me neither. is just to remember we need a generic type that accept any fabricObject interface.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 26, 2022

Code Coverage Summary

> fabric@5.1.0 coverage:report
> nyc report --reporter=lcov --reporter=text

-----------|---------|----------|---------|---------|-----------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                             
-----------|---------|----------|---------|---------|-----------------------------------------------
All files  |   82.13 |     74.6 |   84.36 |   80.75 |                                               
 fabric.js |   82.13 |     74.6 |   84.36 |   80.75 | ...-27690,27806-27807,27828-27869,27884-28043 
-----------|---------|----------|---------|---------|-----------------------------------------------

@asturur asturur merged commit d2571c9 into master Aug 26, 2022
@asturur asturur deleted the convert-more-utils branch September 11, 2022 23:03
frankrousseau pushed a commit to cgwire/fabric.js that referenced this pull request Jan 6, 2023
Co-authored-by: ShaMan123 <shacharnen@gmail.com>
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.

None yet

2 participants