diff --git a/source/website/measuretool.js b/source/website/measuretool.js index aef4cc5..b65e5cc 100644 --- a/source/website/measuretool.js +++ b/source/website/measuretool.js @@ -247,6 +247,7 @@ export class MeasureTool AddValue (this.panel, 'measure_angle', 'Angle of faces', degreeValue.toFixed (1) + '\xB0'); } } + this.Resize (); } Resize () @@ -255,10 +256,12 @@ export class MeasureTool return; } let canvas = this.viewer.GetCanvas (); - let rect = canvas.getBoundingClientRect (); - this.panel.style.left = (rect.left + 1) + 'px'; - this.panel.style.top = (rect.top + 1) + 'px'; - this.panel.style.width = (rect.right - rect.left - 2) + 'px'; + let canvasRect = canvas.getBoundingClientRect (); + let panelRect = this.panel.getBoundingClientRect (); + let canvasWidth = canvasRect.right - canvasRect.left; + let panelWidth = panelRect.right - panelRect.left; + this.panel.style.left = (canvasRect.left + (canvasWidth - panelWidth) / 2) + 'px'; + this.panel.style.top = (canvasRect.top + 10) + 'px'; } ClearMarkers () diff --git a/website/css/website.css b/website/css/website.css index 0555093..a47e256 100644 --- a/website/css/website.css +++ b/website/css/website.css @@ -273,12 +273,9 @@ div.ov_bottom_floating_panel div.ov_floating_panel_button div.ov_measure_panel { - padding: 10px; - box-sizing: border-box; - display: flex; - flex-wrap: wrap; - justify-content: center; + padding: 6px 15px; position: absolute; + border-radius: 30px; left : 0px; top : 0px; } @@ -286,6 +283,7 @@ div.ov_measure_panel div.ov_measure_panel div.ov_svg_icon { color: inherit; + margin-bottom: 2px; } div.ov_measure_panel div.ov_measure_value