Fixed positioning bug in button.

This commit is contained in:
2019-08-08 14:32:55 +02:00
parent f5cf8115af
commit d48139c40f
69 changed files with 90 additions and 83 deletions
+19 -12
View File
@@ -2666,8 +2666,8 @@
//--------------------
if (this.badge) {
this.removeChild(this.badge);
const width = this.width;
const height = this.height;
const width = this._width;
const height = this._height;
this.addChild(this.badge);
const badge = this.badge;
@@ -3067,7 +3067,7 @@
},
opts
);
this.opts.textStyle = Object.assign({}, theme.textStyle, this.opts.textStyle);
this.opts.textStyleActive = Object.assign({}, theme.textStyleActive, this.opts.textStyleActive);
@@ -3384,8 +3384,10 @@
* @param {*} event
*/
onStart(event) {
if ((this.opts.maxWidth != null && this.__initWidth > this.opts.maxWidth) || (this.opts.maxHeight != null && this.__initHeight > this.opts.maxHeight)) {
if (
(this.opts.maxWidth != null && this.__initWidth > this.opts.maxWidth) ||
(this.opts.maxHeight != null && this.__initHeight > this.opts.maxHeight)
) {
this.__dragging = true;
this.capture(event);
@@ -3453,6 +3455,7 @@
// stack!
const distanceToTop = this.container.y;
const distanceToBottom = this.opts.maxHeight - this.container.y - this.__initHeight;
if (distanceToTop > 0) {
throwProps.y.end = 0;
} else if (distanceToBottom > 0) {
@@ -3492,8 +3495,10 @@
* @param {*} event
*/
onScroll(event) {
if ((this.opts.maxWidth != null && this.__initWidth > this.opts.maxWidth) || (this.opts.maxHeight != null && this.__initHeight > this.opts.maxHeight)) {
if (
(this.opts.maxWidth != null && this.__initWidth > this.opts.maxWidth) ||
(this.opts.maxHeight != null && this.__initHeight > this.opts.maxHeight)
) {
this.capture(event);
if (this.opts.orientation === 'horizontal') {
@@ -11189,6 +11194,8 @@
}
}
/* eslint-disable no-unused-vars */
/** A container for scatter objects, which uses a single InteractionMapper
* for all children. This reduces the number of registered event handlers
* and covers the common use case that multiple objects are scattered
@@ -11519,8 +11526,6 @@
roundPixel(value) {
// UO: Should be obsolete because Renderer supports roundPixels by default
return value
let res = this.renderer.resolution;
return Math.round(value * res) / res
}
get container() {
@@ -12336,7 +12341,7 @@
}
}
/* global ThrowPropsPlugin */
/* eslint-disable no-unused-vars */
class Ticks {
get reservedPrefixes() {
@@ -12730,6 +12735,7 @@
this.minZoom = 1;
this.maxZoom = 12000;
this.scroll = 0;
this.draggable = false;
this.deltas = [];
this.labelDates = [];
this.colorRanges = [];
@@ -13007,6 +13013,9 @@
return
}
this.scroll += delta.x;
if (this.draggable) {
this.y += delta.y;
}
while (this.deltas.length > 10) {
this.deltas.pop(0);
}
@@ -13022,7 +13031,6 @@
// let vel = ThrowPropsPlugin.getVelocity(this, 'delta')
// ThrowPropsPlugin.untrack(this)
// }
this.killTweens();
this.redraw();
let delta = 0;
@@ -13035,7 +13043,6 @@
this.autoScroll = true;
let anchor = interaction.current.mean();
this.keepInBounds(delta, anchor);
console.log("onEnd", delta);
for (let key of interaction.ended.keys()) {
if (interaction.isDoubleTap(key)) {
this.onDoubleTap(event, interaction, key);