Make the marker also stay within the designated area

This commit is contained in:
Baldur Gislason
2023-04-05 15:27:09 +00:00
parent 66e899643c
commit b3c8427232

View File

@@ -9740,6 +9740,8 @@ LGraphNode.prototype.executeAction = function(action)
ctx.strokeRect(margin, y, widget_width - margin * 2, H);
if (w.marker) {
var marker_nvalue = (w.marker - w.options.min) / range;
if(marker_nvalue < 0.0) marker_nvalue = 0.0;
if(marker_nvalue > 1.0) marker_nvalue = 1.0;
ctx.fillStyle = w.hasOwnProperty("marker_color") ? w.marker_color : "#AA9";
ctx.fillRect( margin + marker_nvalue * (widget_width - margin * 2), y, 2, H );
}