mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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.
|
- `Matrix` properties `#b` and `#c` have been reversed to match common standard.
|
||||||
- `#importSVG()`: improve handling of style inheritance for nested `<defs>`.
|
- `#importSVG()`: improve handling of style inheritance for nested `<defs>`.
|
||||||
- Move `PaperScript#execute()` URL argument into `options.url` (#902).
|
- Move `PaperScript#execute()` URL argument into `options.url` (#902).
|
||||||
|
- PaperScript: Only translate `==` to `equals() calls for `Point`, `Size` and
|
||||||
|
`Color` (#1043).
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- Use unified code-base for browsers, Node.js, Electron, and anything
|
- Use unified code-base for browsers, Node.js, Electron, and anything
|
||||||
|
|
|
@ -31,9 +31,8 @@ Base.exports.PaperScript = (function() {
|
||||||
'*': '__multiply',
|
'*': '__multiply',
|
||||||
'/': '__divide',
|
'/': '__divide',
|
||||||
'%': '__modulo',
|
'%': '__modulo',
|
||||||
// Use the real equals.
|
'==': '__equals',
|
||||||
'==': 'equals',
|
'!=': '__equals'
|
||||||
'!=': 'equals'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var unaryOperators = {
|
var unaryOperators = {
|
||||||
|
@ -43,7 +42,7 @@ Base.exports.PaperScript = (function() {
|
||||||
|
|
||||||
// Inject underscored math methods as aliases to Point, Size and Color.
|
// Inject underscored math methods as aliases to Point, Size and Color.
|
||||||
var fields = Base.each(
|
var fields = Base.each(
|
||||||
['add', 'subtract', 'multiply', 'divide', 'modulo', 'negate'],
|
['add', 'subtract', 'multiply', 'divide', 'modulo', 'equals', 'negate'],
|
||||||
function(name) {
|
function(name) {
|
||||||
// Create an alias for each math method to be injected into the
|
// Create an alias for each math method to be injected into the
|
||||||
// classes using Straps.js' #inject()
|
// classes using Straps.js' #inject()
|
||||||
|
|
Loading…
Reference in a new issue