浏览代码

Added more horizontal lines to the mesh if height is great enough

Malte Veerman 6 年之前
父节点
当前提交
8d6edb1af2
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      import/qml/FanItem.qml

+ 2 - 2
import/qml/FanItem.qml

@@ -58,7 +58,7 @@ Item {
         id: graph
         id: graph
 
 
         property int fontSize: MoreMath.bound(8, height / 20 + 1, 16)
         property int fontSize: MoreMath.bound(8, height / 20 + 1, 16)
-        property int verticalScalaCount: 6
+        property int verticalScalaCount: height > Kirigami.Units.gridUnit * 30 ? 11 : 6
         property var horIntervals: MoreMath.intervals(root.convertedMinTemp, root.convertedMaxTemp, 10)
         property var horIntervals: MoreMath.intervals(root.convertedMinTemp, root.convertedMaxTemp, 10)
 
 
         anchors {
         anchors {
@@ -224,7 +224,7 @@ Item {
                     c.strokeStyle = Colors.setAlpha(Kirigami.Theme.textColor, 0.3);
                     c.strokeStyle = Colors.setAlpha(Kirigami.Theme.textColor, 0.3);
 
 
                     //horizontal lines
                     //horizontal lines
-                    for (var i=0; i<=100; i+=20) {
+                    for (var i=0; i<=100; i+=100/(graph.verticalScalaCount-1)) {
                         var y = graphBackground.scaleY(i*2.55);
                         var y = graphBackground.scaleY(i*2.55);
                         if (i != 0 && i != 100) {
                         if (i != 0 && i != 100) {
                             for (var j=0; j<=width; j+=15) {
                             for (var j=0; j<=width; j+=15) {