From b1bac3db3e33feee80179facd5363e6e71047dfc Mon Sep 17 00:00:00 2001 From: Thomas Zorroche Date: Tue, 26 Jan 2021 11:27:53 +0100 Subject: [PATCH] [Panorama Viewer] draw static grid inside panorama viewer --- meshroom/ui/qml/Viewer/PanoramaViewer.qml | 30 ++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/meshroom/ui/qml/Viewer/PanoramaViewer.qml b/meshroom/ui/qml/Viewer/PanoramaViewer.qml index 12969bf0..a7e92d02 100644 --- a/meshroom/ui/qml/Viewer/PanoramaViewer.qml +++ b/meshroom/ui/qml/Viewer/PanoramaViewer.qml @@ -62,11 +62,12 @@ AliceVision.PanoramaViewer { Item { id: containerPanorama + z: 10 Rectangle { width: 3000 height: 1000 //color: mouseAreaPano.containsMouse? "red" : "green" - color: "grey" + color: "transparent" MouseArea { id: mouseAreaPano anchors.fill: parent @@ -101,6 +102,33 @@ AliceVision.PanoramaViewer { isRotating = false; } } + + // Grid Panorama Viewer + Canvas { + id: gridPano + anchors.fill : parent + property int wgrid: 40 + onPaint: { + var ctx = getContext("2d") + ctx.lineWidth = 1.0 + ctx.shadowBlur = 0 + ctx.strokeStyle = "grey" + var nrows = height/wgrid; + for(var i=0; i < nrows+1; i++){ + ctx.moveTo(0, wgrid*i); + ctx.lineTo(width, wgrid*i); + } + + var ncols = width/wgrid + for(var j=0; j < ncols+1; j++){ + ctx.moveTo(wgrid*j, 0); + ctx.lineTo(wgrid*j, height); + } + + ctx.closePath() + ctx.stroke() + } + } } }