mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 02:37:59 +08:00
added new clearBeforeDraw Layer property which enables you to skip canvas clearing before each draw. Added new warn() method to test suite, and added error and warning colorings to the test counter
This commit is contained in:
@@ -1,14 +1,22 @@
|
||||
var numTests = 0;
|
||||
var testCounter = null;
|
||||
|
||||
function test(condition, message, dataUrlTest) {
|
||||
function warn(condition, message) {
|
||||
test(condition, message, true);
|
||||
}
|
||||
function test(condition, message, warn) {
|
||||
if(!condition) {
|
||||
if(dataUrlTest) {
|
||||
if(warn) {
|
||||
testCounter.style.backgroundColor = 'orange';
|
||||
testCounter.style.color = 'black';
|
||||
console.warn(message + ' (NOTE: use Google Chrome for data url comparisons)');
|
||||
}
|
||||
else {
|
||||
testCounter.style.backgroundColor = 'red';
|
||||
testCounter.style.color = 'black';
|
||||
throw new Error(message);
|
||||
}
|
||||
|
||||
}
|
||||
numTests++;
|
||||
|
||||
|
Reference in New Issue
Block a user