From ae62d3d26ae01af6a842cca00b66d6a024d9bba7 Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Tue, 15 Feb 2022 18:59:14 +0100 Subject: [PATCH] Fixing X Cursors' history and label position. --- .../eu/ad5001/LogarithmPlotter/AppMenuBar.qml | 2 +- .../js/history/editproperty.js | 4 ++-- .../LogarithmPlotter/js/objs/xcursor.js | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml index b300335..7caf71f 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml @@ -156,7 +156,7 @@ MenuBar { Action { text: qsTr("&User manual") icon.name: 'documentation' - onTriggered: Qt.openUrlExternally("https://git.ad5001.eu/Ad5001/LogarithmPlotter/wiki") + onTriggered: Qt.openUrlExternally("https://git.ad5001.eu/Ad5001/LogarithmPlotter/wiki/User-Manual") } Action { text: qsTr("&Changelog") diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/history/editproperty.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/history/editproperty.js index 1119096..de5c1f3 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/history/editproperty.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/history/editproperty.js @@ -84,8 +84,8 @@ class EditedProperty extends C.Action { this.next = this.propertyType.translatedValues[this.propertyType.values.indexOf(this.newValue)] break; case "ObjectType": - this.prev = this.previousValue.name - this.next = this.newValue.name + this.prev = this.previousValue == null ? "null" : this.previousValue.name + this.next = this.newValue == null ? "null" : this.newValue.name break; case "List": this.prev = this.previousValue.join(",") diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/xcursor.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/xcursor.js index 3d0d28c..a0ca7f1 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/xcursor.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/xcursor.js @@ -146,9 +146,15 @@ class XCursor extends Common.DrawableObject { switch(this.labelPosition) { case 'left': + case 'above-left': + case 'below-left': + case 'below': + case 'above': canvas.drawVisibleText(ctx, text, xpos-textSize.width-5, textSize.height+5) break; case 'right': + case 'above-right': + case 'below-right': canvas.drawVisibleText(ctx, text, xpos+5, textSize.height+5) break; } @@ -159,11 +165,25 @@ class XCursor extends Common.DrawableObject { var ypox = canvas.y2px(this.targetElement.execute(this.x.execute())) switch(this.labelPosition) { case 'left': + case 'below': + case 'above': canvas.drawVisibleText(ctx, text, xpos-textSize.width-5, ypox+textSize.height) break; + case 'above-left': + canvas.drawVisibleText(ctx, text, xpos-textSize.width-5, ypox+textSize.height+12) + break; + case 'below-left': + canvas.drawVisibleText(ctx, text, xpos-textSize.width-5, ypox+textSize.height-12) + break; case 'right': canvas.drawVisibleText(ctx, text, xpos+5, ypox+textSize.height) break; + case 'above-right': + canvas.drawVisibleText(ctx, text, xpos+5, ypox+textSize.height+12) + break; + case 'below-right': + canvas.drawVisibleText(ctx, text, xpos+5, ypox+textSize.height-12) + break; } } }