Browse Source

Fixed offset in zooming with scroll when using groups

css_transitions
jos 10 years ago
parent
commit
ad2e235211
2 changed files with 5 additions and 5 deletions
  1. +2
    -2
      src/timeline/Range.js
  2. +3
    -3
      src/timeline/component/ItemSet.js

+ 2
- 2
src/timeline/Range.js View File

@ -347,7 +347,7 @@ Range.prototype._onMouseWheel = function(event) {
// calculate center, the date to zoom around
var gesture = util.fakeGesture(this, event),
pointer = getPointer(gesture.center, this.timeline.dom.root),
pointer = getPointer(gesture.center, this.timeline.dom.center),
pointerDate = this._pointerToDate(pointer);
this.zoom(scale, pointerDate);
@ -396,7 +396,7 @@ Range.prototype._onPinch = function (event) {
if (event.gesture.touches.length > 1) {
if (!touchParams.center) {
touchParams.center = getPointer(event.gesture.center, this.timeline.dom.root);
touchParams.center = getPointer(event.gesture.center, this.timeline.dom.center);
}
var scale = 1 / event.gesture.scale,

+ 3
- 3
src/timeline/component/ItemSet.js View File

@ -324,9 +324,9 @@ ItemSet.prototype.repaint = function repaint() {
// reposition axis
this.dom.axis.style.top = asSize((orientation == 'top') ?
this.timeline.props.top.height :
this.timeline.props.top.height + this.timeline.props.center.height +
this.timeline.props.border.top + this.timeline.props.border.bottom);
(this.timeline.props.top.height + this.timeline.props.border.top) :
(this.timeline.props.top.height + this.timeline.props.center.height +
this.timeline.props.border.top + this.timeline.props.border.bottom));
this.dom.axis.style.left = this.timeline.props.border.left + 'px';
// check if this component is resized

Loading…
Cancel
Save