|
@@ -8,12 +8,12 @@ import "components" as Comps
|
|
|
|
|
|
|
|
|
|
|
|
|
ApplicationWindow {
|
|
ApplicationWindow {
|
|
|
|
|
+ property bool portrait: Screen.height > Screen.width ? true : false
|
|
|
id: aw
|
|
id: aw
|
|
|
visible: true
|
|
visible: true
|
|
|
- width: 600
|
|
|
|
|
- height: 960
|
|
|
|
|
- visibility: Screen.height > Screen.width ? "FullScreen" : "Windowed"
|
|
|
|
|
-
|
|
|
|
|
|
|
+ width: portrait ? 600 : 1280
|
|
|
|
|
+ height: portrait ? 960 : 720
|
|
|
|
|
+ visibility: portrait ? "FullScreen" : "Windowed"
|
|
|
color: "#fffffe"
|
|
color: "#fffffe"
|
|
|
|
|
|
|
|
Comps.WebSocket {
|
|
Comps.WebSocket {
|
|
@@ -24,15 +24,15 @@ ApplicationWindow {
|
|
|
id: item1
|
|
id: item1
|
|
|
|
|
|
|
|
transformOrigin: Item.Center
|
|
transformOrigin: Item.Center
|
|
|
- rotation: Screen.height > Screen.width ? 90 : 0
|
|
|
|
|
|
|
+ rotation: aw.portrait ? 90 : 0
|
|
|
property alias mouseArea1: mouseArea1
|
|
property alias mouseArea1: mouseArea1
|
|
|
property alias button3: button3
|
|
property alias button3: button3
|
|
|
property int curImage: 1
|
|
property int curImage: 1
|
|
|
property variant pregs: []
|
|
property variant pregs: []
|
|
|
|
|
|
|
|
property string curPDF: "EBA"
|
|
property string curPDF: "EBA"
|
|
|
- width: parent.height
|
|
|
|
|
- height: parent.width
|
|
|
|
|
|
|
+ width: aw.portrait ? parent.height : parent.width
|
|
|
|
|
+ height: aw.portrait ? parent.width : parent.height
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
onCurPDFChanged: {
|
|
onCurPDFChanged: {
|
|
@@ -170,13 +170,9 @@ ApplicationWindow {
|
|
|
if (ctx === null )
|
|
if (ctx === null )
|
|
|
ctx = canvas.getContext("2d");
|
|
ctx = canvas.getContext("2d");
|
|
|
|
|
|
|
|
-
|
|
|
|
|
if ( region === undefined || region.width > 150 || region.height > 150 ) {
|
|
if ( region === undefined || region.width > 150 || region.height > 150 ) {
|
|
|
- console.log("Full", region.width, region.height);
|
|
|
|
|
- if (canvas.isImageLoaded(curImageUrl)) {
|
|
|
|
|
- ctx.drawImage(curImageUrl, 0, 0, canvas.width,
|
|
|
|
|
- canvas.height)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (canvas.isImageLoaded(curImageUrl))
|
|
|
|
|
+ ctx.drawImage(curImageUrl, 0, 0, canvas.width, canvas.height)
|
|
|
var j = 0
|
|
var j = 0
|
|
|
for (j = 0; j < points_array.length; j++) {
|
|
for (j = 0; j < points_array.length; j++) {
|
|
|
if (points_array[j].points.length <= 1)
|
|
if (points_array[j].points.length <= 1)
|
|
@@ -212,7 +208,7 @@ ApplicationWindow {
|
|
|
if (!socket.isOpen)
|
|
if (!socket.isOpen)
|
|
|
return
|
|
return
|
|
|
var point = { x: mouse.x, y: mouse.y }
|
|
var point = { x: mouse.x, y: mouse.y }
|
|
|
- if (distance(last_point, point) <= 61) //distance returns squared dsitance
|
|
|
|
|
|
|
+ if (distance(last_point, point) <= 31) //distance returns squared dsitance
|
|
|
return;
|
|
return;
|
|
|
last_point = point
|
|
last_point = point
|
|
|
canvas.add_point(point)
|
|
canvas.add_point(point)
|