-
-
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
chore(TS): Move more utils to TS #8164
Conversation
Code Coverage Summary
|
parsePreserveAspectRatioAttribute: function(attribute) { | ||
var meetOrSlice = 'meet', alignX = 'Mid', alignY = 'Mid', | ||
aspectRatioAttrs = attribute.split(' '), align; | ||
|
||
if (aspectRatioAttrs && aspectRatioAttrs.length) { | ||
meetOrSlice = aspectRatioAttrs.pop(); | ||
if (meetOrSlice !== 'meet' && meetOrSlice !== 'slice') { | ||
align = meetOrSlice; | ||
meetOrSlice = 'meet'; | ||
} | ||
else if (aspectRatioAttrs.length) { | ||
align = aspectRatioAttrs.pop(); | ||
} | ||
} | ||
//divide align in alignX and alignY | ||
alignX = align !== 'none' ? align.slice(1, 4) : 'none'; | ||
alignY = align !== 'none' ? align.slice(5, 8) : 'none'; | ||
return { | ||
meetOrSlice: meetOrSlice, | ||
alignX: alignX, | ||
alignY: alignY | ||
}; | ||
}, |
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.
this has been rewrote to be TS friendly and readable.
I had to re-read the spec because i couldn't read anymore what this code was doing.
pc = 'pc', | ||
em = 'em', | ||
} | ||
|
||
export type TMat2D = [number, number, number, number, number, number]; |
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.
export type TMat2DBasic = [number,number,number,number];
export type TMat2DAffine = [number,number,number,number,number,number];
export type TMat2D<T> = TMat2DAffine |TMat2DBasic;
export type...
@@ -1,7 +1,6 @@ | |||
//@ts-nocheck | |||
|
|||
import { fabric } from '../../HEADER'; | |||
import { toArray } from '../util'; |
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.
why not import directly from the file lang_array
and not from the index?
That will solve the circular dep
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 what i was doing i removed for now all imports from the main index in util, and where possible i m linking to direct files.
Is probably better to leave the util/index.ts just to create the external facing export for who will use fabric.util
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 src/util/misc/svgParsing.ts
should move to parser
folder
Code Coverage Summary
|
Yes, and there are also some duplicated functions here and there. |
rolling back to before moving svgParsing. can't unbreak what i broke |
cc18599
to
bfee157
Compare
Code Coverage Summary
|
Moving more utils