Warning, /libraries/kquickimageeditor/src/controls/RectangleCutout.qml is written in an unsupported language. File is not indexed.

0001 /* SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
0002  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0003  */
0004 
0005 import QtQuick 2.15
0006 
0007 Item {
0008     id: root
0009     property color color: Qt.rgba(0,0,0,0.5)
0010     property real insideX: 0
0011     property real insideY: 0
0012     property real insideWidth: width
0013     property real insideHeight: height
0014     // NOTE: Using 4 Rectangles is visibly smoother than using an OpacityMask effect
0015     Rectangle {
0016         id: topTintRect
0017         LayoutMirroring.enabled: false
0018         anchors.left: parent.left
0019         anchors.right: parent.right
0020         anchors.top: parent.top
0021         height: root.insideY
0022         color: root.color
0023     }
0024 
0025     Rectangle {
0026         id: leftTintRect
0027         LayoutMirroring.enabled: false
0028         anchors.left: parent.left
0029         anchors.top: topTintRect.bottom
0030         anchors.bottom: bottomTintRect.top
0031         width: root.insideX
0032         color: root.color
0033     }
0034 
0035     Rectangle {
0036         id: rightTintRect
0037         LayoutMirroring.enabled: false
0038         anchors.right: parent.right
0039         anchors.top: topTintRect.bottom
0040         anchors.bottom: bottomTintRect.top
0041         width: root.width - root.insideX - root.insideWidth
0042         color: root.color
0043     }
0044 
0045     Rectangle {
0046         id: bottomTintRect
0047         LayoutMirroring.enabled: false
0048         anchors.left: parent.left
0049         anchors.right: parent.right
0050         anchors.bottom: parent.bottom
0051         height: root.height - root.insideY - root.insideHeight
0052         color: root.color
0053     }
0054 }