mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-19 09:37:14 +02:00
[Panorama Viewer] draw static grid inside panorama viewer
This commit is contained in:
parent
833d5d9fd6
commit
b1bac3db3e
1 changed files with 29 additions and 1 deletions
|
@ -62,11 +62,12 @@ AliceVision.PanoramaViewer {
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: containerPanorama
|
id: containerPanorama
|
||||||
|
z: 10
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: 3000
|
width: 3000
|
||||||
height: 1000
|
height: 1000
|
||||||
//color: mouseAreaPano.containsMouse? "red" : "green"
|
//color: mouseAreaPano.containsMouse? "red" : "green"
|
||||||
color: "grey"
|
color: "transparent"
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: mouseAreaPano
|
id: mouseAreaPano
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -101,6 +102,33 @@ AliceVision.PanoramaViewer {
|
||||||
isRotating = false;
|
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()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue