mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
PaperScript: Only translate == to equals() calls for Point, Size and Color.
Closes #1043
This commit is contained in:
parent
648beb33e9
commit
964d8cf7d6
2 changed files with 5 additions and 4 deletions
|
@ -107,6 +107,8 @@ contribute to the code.
|
|||
- `Matrix` properties `#b` and `#c` have been reversed to match common standard.
|
||||
- `#importSVG()`: improve handling of style inheritance for nested `<defs>`.
|
||||
- Move `PaperScript#execute()` URL argument into `options.url` (#902).
|
||||
- PaperScript: Only translate `==` to `equals() calls for `Point`, `Size` and
|
||||
`Color` (#1043).
|
||||
|
||||
### Added
|
||||
- Use unified code-base for browsers, Node.js, Electron, and anything
|
||||
|
|
|
@ -31,9 +31,8 @@ Base.exports.PaperScript = (function() {
|
|||
'*': '__multiply',
|
||||
'/': '__divide',
|
||||
'%': '__modulo',
|
||||
// Use the real equals.
|
||||
'==': 'equals',
|
||||
'!=': 'equals'
|
||||
'==': '__equals',
|
||||
'!=': '__equals'
|
||||
};
|
||||
|
||||
var unaryOperators = {
|
||||
|
@ -43,7 +42,7 @@ Base.exports.PaperScript = (function() {
|
|||
|
||||
// Inject underscored math methods as aliases to Point, Size and Color.
|
||||
var fields = Base.each(
|
||||
['add', 'subtract', 'multiply', 'divide', 'modulo', 'negate'],
|
||||
['add', 'subtract', 'multiply', 'divide', 'modulo', 'equals', 'negate'],
|
||||
function(name) {
|
||||
// Create an alias for each math method to be injected into the
|
||||
// classes using Straps.js' #inject()
|
||||
|
|
Loading…
Reference in a new issue