- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
function TimeViewport(rootElement, container, canvas, minZoom, maxZoom)
{
this.container = container;
this.rootElement = rootElement;
this.lowPassAlpha = 0.38;
this.canvas = canvas;
this.minZoom = minZoom;
this.maxZoom = maxZoom;
this.zoom = minZoom;
this.size = Math.min(1.0, 1.0 / Math.pow(2, this.zoom));
this.left = 0.5 - this.size / 2.0;
this.right = 0.5 + this.size / 2.0;
this.mouse = {
isDown : false,
panning : false,
velocityMode : false,
downPos : {x : 0, y : 0},
movePos : {x : 0, y : 0},
lastMovePos : {x : 0, y : 0}
};
var self = this;
this.filtered = {
"left" : 0.5 - self.size / 4.0,
"right" : 0.5 + self.size / 4.0
};
this.lastRedrawTime = (new Date()).getTime();
this.maxRedrawInterval = 500;
setInterval(function () { if (self.doLowPass != null) self.doLowPass(); }, 17);
this.canvas.onmousedown = function(event) { self.mouseDown(event) };
this.canvas.onmousewheel = function(event) { self.onMouseWheel(event); };
var oldMouseMoveHandler = this.rootElement.onmousemove;
this.rootElement.onmousemove = function (event) {
if (self.mouseMove) self.mouseMove(event);
if (oldMouseMoveHandler != null) oldMouseMoveHandler(event);
};
var oldMouseUpHandler = this.rootElement.onmouseup;
this.rootElement.onmouseup = function (event) {
if (self.mouseUp) self.mouseUp(event);
if (oldMouseUpHandler != null) oldMouseUpHandler(event);
};
var oldMouseLeaveHandler = this.rootElement.onmouseleave;
this.rootElement.onmouseleave = function (event) {
if (self.mouseLeave) self.mouseLeave(event);
if (oldMouseLeaveHandler != null) oldMouseLeaveHandler(event);
};
};
bot-minurast 30.03.2013 15:51 # 0
deep 30.03.2013 16:25 # +1
eth0 30.03.2013 17:54 # +6
Через десять минут Штирлиц проснётся, это была многолетняя привычка.
movaxbx 31.03.2013 11:43 # +8
anonimb84a2f6fd141 07.04.2013 00:09 # −4