Warning, /education/gcompris/src/activities/simplepaint/PaintCursor.qml is written in an unsupported language. File is not indexed.
0001 /* GCompris - PaintCursor.qml 0002 * 0003 * SPDX-FileCopyrightText: 2018 Bruno Coudoin <bruno.coudoin@gcompris.net> 0004 * 0005 * Authors: 0006 * Christof Petig and Ingo Konrad (GTK+ version) 0007 * Bruno Coudoin <bruno.coudoin@gcompris.net> (Qt Quick port) 0008 * 0009 * SPDX-License-Identifier: GPL-3.0-or-later 0010 */ 0011 import QtQuick 2.12 0012 import "simplepaint.js" as Activity 0013 import GCompris 1.0 0014 0015 0016 Item { 0017 id: cursor 0018 property int ix 0019 property int iy 0020 property int nbx 0021 property int nby 0022 property int initialX 0023 // Warning testing parent here, just to avoid an error at deletion time 0024 property int r: parent ? Math.min(Math.floor((parent.width - initialX) / nbx / 2), Math.floor((parent.height - bar.height) / nby / 2)) : 0 0025 property int offsetX: parent ? Math.floor((initialX + parent.width % (width * nbx)) / 2) : 0 0026 property int offsetY: parent ? 10 : 0 0027 x: width * ix + offsetX 0028 y: height * iy + offsetY 0029 width: r * 2 0030 height: r * 2 0031 0032 Image { 0033 scale: 0.9 0034 width: parent.height 0035 height: parent.height 0036 sourceSize.width: height 0037 sourceSize.height: height 0038 source: Activity.url + "cursor.svg" 0039 visible: true 0040 anchors.centerIn: parent 0041 } 0042 0043 0044 }