Chart aspect ratio buttom improved

This commit is contained in:
Luis Fernando Molina committed 2018-10-03 10:00:56 +02:00
1 parent 292b104168
commit cf73d625b9
4 files changed
+16 -4

No files matched your search

+6 -3
View File
@@ -44,7 +44,7 @@
canDrawIcon = true;
}
icon.src = "Images/aspect.ratio.Y.png";
icon.src = "Images/Icons/chart-scale.png";
thisObject.container.eventHandler.listenToEvent('Mouse Wheel', onMouseWheel);
@@ -52,6 +52,8 @@
function onMouseWheel(pDelta) {
if (viewPort.isMinZoom() === false) { return; } // We only make this button to work at the min zoom level.
if (pDelta < 0) {
pDelta = -0.1;
} else {
@@ -100,11 +102,12 @@
thisObject.container.frame.draw(false, false);
if (canDrawIcon === false) { return; }
if (viewPort.isMinZoom() === false) { return; } // We only show this button at the min zoom level.
let breakpointsHeight = 15;
let imageHeight = 30;
let imageWidth = 30;
let imageHeight = 15;
let imageWidth = 15;
let imagePoint = {
x: 10,
Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

+10 -1
View File
@@ -8,6 +8,7 @@ function newViewPort() {
const BOTTOM_MARGIN = 15 + BOTTOM_SPACE_HEIGHT;
const LEFT_MARGIN = 50;
const RIGHT_MARGIN = 50;
const MIN_ZOOM_LEVEL = -28.25
let thisObject = {
visibleArea: undefined,
@@ -17,6 +18,7 @@ function newViewPort() {
mousePosition: undefined,
newZoomLevel: newZoomLevel,
applyZoom: applyZoom,
isMinZoom: isMinZoom,
zoomFontSize: zoomFontSize,
zoomThisPoint: zoomThisPoint,
unzoomThisPoint: unzoomThisPoint,
@@ -169,6 +171,13 @@ function newViewPort() {
return true;
}
function isMinZoom() {
/* returns true is we are currently at the min zoom level. */
if (thisObject.zoomTargetLevel === MIN_ZOOM_LEVEL) { return true; } else { return false;}
}
function applyZoom(amount) {
//console.log("applyZoom amount: " + amount);
@@ -216,7 +225,7 @@ function newViewPort() {
amount = amount / 4;
}
if (thisObject.zoomTargetLevel + amount < -28.25) {
if (thisObject.zoomTargetLevel + amount < MIN_ZOOM_LEVEL) {
return false;
}