mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Minor fixes in comments and tests.
This commit is contained in:
parent
76d07892d1
commit
4c035ada36
3 changed files with 5 additions and 3 deletions
|
@ -84,14 +84,14 @@ var DomElement = new function() {
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if element is invisibile (display: none, ...).
|
* Checks if element is invisible (display: none, ...).
|
||||||
*/
|
*/
|
||||||
isInvisible: function(el) {
|
isInvisible: function(el) {
|
||||||
return DomElement.getSize(el).equals(new Size(0, 0));
|
return DomElement.getSize(el).equals(new Size(0, 0));
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if element is visibile in current viewport.
|
* Checks if element is visible in current viewport.
|
||||||
*/
|
*/
|
||||||
isInView: function(el) {
|
isInView: function(el) {
|
||||||
// See if the viewport bounds intersect with the windows rectangle
|
// See if the viewport bounds intersect with the windows rectangle
|
||||||
|
|
|
@ -54,6 +54,8 @@ var Color = Base.extend(new function() {
|
||||||
var componentParsers = {},
|
var componentParsers = {},
|
||||||
// Cache and canvas context for color name lookup
|
// Cache and canvas context for color name lookup
|
||||||
namedColors = {
|
namedColors = {
|
||||||
|
// node-canvas appears to return wrong values for 'transparent'.
|
||||||
|
// Fix it by having it pre-cashed here:
|
||||||
transparent: [0, 0, 0, 0]
|
transparent: [0, 0, 0, 0]
|
||||||
},
|
},
|
||||||
colorCtx;
|
colorCtx;
|
||||||
|
|
|
@ -67,7 +67,7 @@ test('Creating Colors', function() {
|
||||||
'Color from hex string');
|
'Color from hex string');
|
||||||
|
|
||||||
equals(new Color('#FF3300'), new Color(1, 0.2, 0),
|
equals(new Color('#FF3300'), new Color(1, 0.2, 0),
|
||||||
'Color from hex string');
|
'Color from uppercase hex string');
|
||||||
|
|
||||||
equals(new Color('#ff000099'), new Color(1, 0, 0, .6),
|
equals(new Color('#ff000099'), new Color(1, 0, 0, .6),
|
||||||
'Color from hex code with alpha');
|
'Color from hex code with alpha');
|
||||||
|
|
Loading…
Reference in a new issue