mirror of
https://github.com/konvajs/konva.git
synced 2025-10-08 00:14:23 +08:00
prettier
This commit is contained in:
@@ -7,14 +7,14 @@ var height = 300;
|
||||
|
||||
var VERSION = Konva.version === 'dev' ? 'new' : 'old';
|
||||
|
||||
window.requestAnimFrame = (function() {
|
||||
window.requestAnimFrame = (function () {
|
||||
return (
|
||||
window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
function(callback) {
|
||||
function (callback) {
|
||||
window.setTimeout(callback, 1000 / 30);
|
||||
}
|
||||
);
|
||||
@@ -30,7 +30,7 @@ function fpsCounter() {
|
||||
$('html').append(stats.domElement);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$(function () {
|
||||
fpsCounter();
|
||||
|
||||
make_stage();
|
||||
@@ -40,7 +40,7 @@ $(function() {
|
||||
|
||||
circles = [];
|
||||
for (var n = 0; n < 2500; n++) {
|
||||
(function() {
|
||||
(function () {
|
||||
var color = colors[colorIndex++];
|
||||
if (colorIndex >= colors.length) {
|
||||
colorIndex = 0;
|
||||
@@ -74,7 +74,7 @@ function animate(lastTime) {
|
||||
|
||||
circlesLayer.draw();
|
||||
stats.end();
|
||||
requestAnimFrame(function() {
|
||||
requestAnimFrame(function () {
|
||||
animate(lastTime);
|
||||
});
|
||||
}
|
||||
@@ -86,7 +86,7 @@ function make_shape(color) {
|
||||
fillLinearGradientColorStops: [0, 'black', 1, color],
|
||||
// fill: color,
|
||||
width: 10,
|
||||
height: 10
|
||||
height: 10,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -94,11 +94,11 @@ function make_stage() {
|
||||
stage = new Konva.Stage({
|
||||
container: 'container',
|
||||
width: width,
|
||||
height: height
|
||||
height: height,
|
||||
});
|
||||
|
||||
// circlesLayer = new Konva.FastLayer();
|
||||
circlesLayer = new Konva.Layer({
|
||||
hitGraphEnabled: false
|
||||
hitGraphEnabled: false,
|
||||
});
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
Konva.WebGLLayer = function(config) {
|
||||
Konva.WebGLLayer = function (config) {
|
||||
this.nodeType = 'Layer';
|
||||
this.canvas = new Konva.SceneWebGLCanvas();
|
||||
this.hitCanvas = new Konva.HitCanvas({
|
||||
pixelRatio: 1
|
||||
pixelRatio: 1,
|
||||
});
|
||||
// call super constructor
|
||||
Konva.BaseLayer.call(this, config);
|
||||
@@ -10,7 +10,7 @@ Konva.WebGLLayer = function(config) {
|
||||
|
||||
Konva.Util.extend(Konva.WebGLLayer, Konva.Layer);
|
||||
|
||||
Konva.SceneWebGLCanvas = function(config) {
|
||||
Konva.SceneWebGLCanvas = function (config) {
|
||||
var conf = config || {};
|
||||
var width = conf.width || 0,
|
||||
height = conf.height || 0;
|
||||
@@ -23,7 +23,7 @@ Konva.SceneWebGLCanvas = function(config) {
|
||||
|
||||
Konva.Util.extend(Konva.SceneWebGLCanvas, Konva.SceneCanvas);
|
||||
|
||||
Konva.SceneWebGLContext = function(canvas) {
|
||||
Konva.SceneWebGLContext = function (canvas) {
|
||||
this.canvas = canvas;
|
||||
this._context = canvas._canvas.getContext('webgl-2d');
|
||||
|
||||
|
Reference in New Issue
Block a user