Comparing version 0.6.1 to 0.6.3
{ | ||
"name": "karas", | ||
"version": "0.6.1", | ||
"version": "0.6.3", | ||
"description": "A flexible JavaScript framework for graphics programming on Canvas/Svg.", | ||
@@ -5,0 +5,0 @@ "maintainers": [ |
@@ -18,4 +18,4 @@ import Geom from './Geom'; | ||
render(renderMode) { | ||
let { isDestroyed, cx, cy, display, fill, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none') { | ||
let { isDestroyed, cx, cy, display, visibility, fill, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none' || visibility === 'hidden') { | ||
return; | ||
@@ -22,0 +22,0 @@ } |
@@ -25,4 +25,4 @@ import Geom from './Geom'; | ||
render(renderMode) { | ||
let { isDestroyed, cx, cy, display, fill, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none') { | ||
let { isDestroyed, cx, cy, display, visibility, fill, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none' || visibility === 'hidden') { | ||
return; | ||
@@ -29,0 +29,0 @@ } |
@@ -167,3 +167,3 @@ import Xom from '../node/Xom'; | ||
super.render(renderMode); | ||
let { isDestroyed, computedStyle: { display } } = this; | ||
let { isDestroyed, computedStyle: { display, visibility } } = this; | ||
if(isDestroyed || display === 'none') { | ||
@@ -173,2 +173,3 @@ return { | ||
display, | ||
visibility, | ||
}; | ||
@@ -175,0 +176,0 @@ } |
@@ -33,4 +33,4 @@ import Geom from './Geom'; | ||
render(renderMode) { | ||
let { isDestroyed, display, originX, originY, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none') { | ||
let { isDestroyed, display, visibility, originX, originY, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none' || visibility === 'hidden') { | ||
return; | ||
@@ -37,0 +37,0 @@ } |
@@ -15,4 +15,4 @@ import Geom from './Geom'; | ||
render(renderMode) { | ||
let { isDestroyed, originX, originY, display, fill, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none') { | ||
let { isDestroyed, originX, originY, display, visibility, fill, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none' || visibility === 'hidden') { | ||
return; | ||
@@ -19,0 +19,0 @@ } |
@@ -22,4 +22,4 @@ import Geom from './Geom'; | ||
render(renderMode) { | ||
let { isDestroyed, originX, originY, display, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none') { | ||
let { isDestroyed, originX, originY, display, visibility, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none' || visibility === 'hidden') { | ||
return; | ||
@@ -26,0 +26,0 @@ } |
@@ -10,4 +10,4 @@ import Geom from './Geom'; | ||
render(renderMode) { | ||
let { isDestroyed, originX, originY, display, fill, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none') { | ||
let { isDestroyed, originX, originY, display, visibility, fill, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none' || visibility === 'hidden') { | ||
return; | ||
@@ -14,0 +14,0 @@ } |
@@ -68,4 +68,4 @@ import Geom from './Geom'; | ||
render(renderMode) { | ||
let { isDestroyed, cx, cy, display, fill, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none') { | ||
let { isDestroyed, cx, cy, display, visibility, fill, stroke, strokeWidth, strokeDasharray } = super.render(renderMode); | ||
if(isDestroyed || display === 'none' || visibility === 'hidden') { | ||
return; | ||
@@ -72,0 +72,0 @@ } |
@@ -16,2 +16,4 @@ import Dom from './node/Dom'; | ||
import sort from './util/sort'; | ||
import util from './util/util'; | ||
import frame from './animate/frame'; | ||
@@ -55,2 +57,5 @@ Geom.register('$line', Line); | ||
}, | ||
Root, | ||
Dom, | ||
Img, | ||
Geom, | ||
@@ -61,2 +66,4 @@ mode, | ||
sort, | ||
util, | ||
frame, | ||
}; | ||
@@ -63,0 +70,0 @@ |
@@ -246,3 +246,3 @@ import Event from '../util/Event'; | ||
if(sr[fn]) { | ||
sr[fn].apply(sr, arguments); | ||
return sr[fn].apply(sr, arguments); | ||
} | ||
@@ -249,0 +249,0 @@ }; |
@@ -1042,4 +1042,4 @@ import Xom from './Xom'; | ||
super.render(renderMode); | ||
let { isDestroyed, computedStyle: { display }, flowChildren, children } = this; | ||
if(isDestroyed || display === 'none') { | ||
let { isDestroyed, computedStyle: { display, visibility }, flowChildren, children } = this; | ||
if(isDestroyed || display === 'none' || visibility === 'hidden') { | ||
return; | ||
@@ -1046,0 +1046,0 @@ } |
@@ -223,3 +223,3 @@ import Dom from '../node/Dom'; | ||
// 清除前得恢复默认matrix,防止每次布局改变了属性 | ||
this.__ctx.setTransform([1, 0, 0, 1, 0, 0]); | ||
this.__ctx.setTransform(1, 0, 0, 1, 0, 0); | ||
this.__ctx.clearRect(0, 0, this.__mw, this.__mh); | ||
@@ -244,5 +244,9 @@ } | ||
clone.forEach(cb => { | ||
cb && cb(); | ||
if(util.isFunction(cb)) { | ||
cb(); | ||
} | ||
}); | ||
cb && cb(); | ||
if(util.isFunction(cb)) { | ||
cb(); | ||
} | ||
this.emit(Event.KARAS_REFRESH); | ||
@@ -249,0 +253,0 @@ }); |
@@ -157,5 +157,2 @@ import Node from './Node'; | ||
} = currentStyle; | ||
if(isDestroyed || display === 'none') { | ||
return; | ||
} | ||
if(width.unit !== unit.AUTO) { | ||
@@ -182,2 +179,6 @@ switch(width.unit) { | ||
this.__matrix = this.__matrixEvent = null; | ||
if(isDestroyed || display === 'none') { | ||
computedStyle.width = computedStyle.height = computedStyle.outerWidth = computedStyle.outerHeight = 0; | ||
return; | ||
} | ||
if(display === 'block') { | ||
@@ -383,2 +384,3 @@ this.__layoutBlock(data); | ||
borderLeftStyle, | ||
visibility, | ||
} = computedStyle; | ||
@@ -389,5 +391,2 @@ let { | ||
} = currentStyle; | ||
if(isDestroyed || display === 'none') { | ||
return; | ||
} | ||
// 使用rx和ry渲染位置,考虑了relative和translate影响 | ||
@@ -434,2 +433,5 @@ let { rx: x, ry: y } = this; | ||
} | ||
if(isDestroyed || display === 'none' || visibility === 'hidden') { | ||
return; | ||
} | ||
// 先渲染渐变,没有则背景色 | ||
@@ -436,0 +438,0 @@ if(backgroundGradient) { |
@@ -47,2 +47,3 @@ import util from '../util/util'; | ||
transformOrigin: 'center', | ||
visibility: 'visible', | ||
}; | ||
@@ -49,0 +50,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
960317
15437