Minor fixes in comments and tests.

This commit is contained in:
Jürg Lehni 2018-10-10 23:03:38 +02:00
parent 76d07892d1
commit 4c035ada36
3 changed files with 5 additions and 3 deletions

View file

@ -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) {
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) {
// See if the viewport bounds intersect with the windows rectangle

View file

@ -54,6 +54,8 @@ var Color = Base.extend(new function() {
var componentParsers = {},
// Cache and canvas context for color name lookup
namedColors = {
// node-canvas appears to return wrong values for 'transparent'.
// Fix it by having it pre-cashed here:
transparent: [0, 0, 0, 0]
},
colorCtx;

View file

@ -67,7 +67,7 @@ test('Creating Colors', function() {
'Color from hex string');
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),
'Color from hex code with alpha');