Warning, /multimedia/kdenlive/src/monitor/view/OverlayCenterDiagonal.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2020 Jean-Baptiste Mardelle <jb@kdenlive.org> 0003 SPDX-FileCopyrightText: 2018 Willian Pessoa 0004 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 import QtQuick.Controls 2.15 0008 import QtQuick 2.15 0009 0010 Item { 0011 id: overlay 0012 property double diagonalLength: Math.sqrt(Math.pow(parent.height, 2) + Math.pow(parent.width, 2)) 0013 0014 function degreesRotation(width, height) { 0015 var a = height/width; 0016 var b = Math.sqrt(1 + Math.pow(a, 2)); 0017 var angle = Math.acos(Math.pow(a,2) / (a * b)); 0018 return angle * (180 / Math.PI); 0019 } 0020 0021 Rectangle { 0022 color: root.overlayColor 0023 width: overlay.diagonalLength 0024 height: 1 0025 rotation: degreesRotation(parent.height, parent.width) 0026 anchors.centerIn: parent 0027 antialiasing: true 0028 } 0029 0030 Rectangle { 0031 color: root.overlayColor 0032 height: overlay.diagonalLength 0033 width: 1 0034 rotation: degreesRotation(parent.width, parent.height) 0035 anchors.centerIn: parent 0036 antialiasing: true 0037 } 0038 }