-
-
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) Converting Object to a class #8322
Changes from 3 commits
3e16059
44b96d5
a755104
cb4eb2c
2ea8540
09d32e3
fa35c31
443ced7
24e02d4
0d9f0f1
b77dd21
530775f
4fdf9e3
c5a42ea
0471973
ee394dc
f05ee9c
66c6ea2
2e55cde
b6deb8b
fa80e4e
3e93f57
65e4c33
7030b16
a2fa127
fc8bcbb
1a426af
247f8e1
cabc310
ab2da0b
c661f9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
//@ts-nocheck | ||
import { fabric as fabricHeader } from '../../HEADER'; | ||
|
||
(function (global) { | ||
var fabric = global.fabric; | ||
|
||
|
@@ -142,4 +144,10 @@ | |
once: once, | ||
off: off, | ||
}; | ||
fabricHeader.Observable = { | ||
fire: fire, | ||
on: on, | ||
once: once, | ||
off: off, | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is some bullshit i did when i was half asleep. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I saw that in #8103 and removed that there as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems like i added it here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The diff is too harsh. |
||
})(typeof exports !== 'undefined' ? exports : window); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
//@ts-nocheck | ||
import { fabric } from '../../HEADER'; | ||
import { Color } from '../color'; | ||
import { toFixed } from '../util/misc/toFixed'; | ||
import { colorAttributes } from './constants'; | ||
import { FabricObject } from '../shapes/object.class'; | ||
|
||
/** | ||
* @private | ||
|
@@ -19,10 +19,10 @@ export function setStrokeFillOpacity(attributes) { | |
} | ||
|
||
if (typeof attributes[attr] === 'undefined') { | ||
if (!fabric.Object.prototype[attr]) { | ||
if (!FabricObject.prototype[attr]) { | ||
continue; | ||
} | ||
attributes[attr] = fabric.Object.prototype[attr]; | ||
attributes[attr] = FabricObject.prototype[attr]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this part can be removed in the next iteration. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code speaks about opacity, i assume that if the svg specify opacity 0.5, we have to transfer that on a color, and that color if not differently specified is our default one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good point There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps it should be exposed as a static method on FabricObject...? |
||
} | ||
|
||
if (attributes[attr].indexOf('url(') === 0) { | ||
|
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 is not the place for the __uid. i remember @ShaMan123 already worked to put it somewhere else