Changeset View
Changeset View
Standalone View
Standalone View
src/activities/digital_electricity/components/TerminalPoint.qml
- This file was copied to src/activities/analog_electricity/TerminalPoint.qml.
Show All 20 Lines | |||||
21 | */ | 21 | */ | ||
22 | import QtQuick 2.6 | 22 | import QtQuick 2.6 | ||
23 | import GCompris 1.0 | 23 | import GCompris 1.0 | ||
24 | 24 | | |||
25 | import "../digital_electricity.js" as Activity | 25 | import "../digital_electricity.js" as Activity | ||
26 | 26 | | |||
27 | Image { | 27 | Image { | ||
28 | id: terminalPoint | 28 | id: terminalPoint | ||
29 | | ||||
30 | property double posX | 29 | property double posX | ||
31 | property double posY | 30 | property double posY | ||
32 | property double size: parent.terminalSize | 31 | property double size: parent.terminalSize | ||
33 | property bool selected: false | 32 | property bool selected: false | ||
34 | property string type | 33 | property string type | ||
35 | property int value: 0 | 34 | property int value: 0 | ||
36 | property var wires: [] | 35 | property var wires: [] | ||
37 | 36 | | |||
38 | width: size * parent.paintedHeight | 37 | width: size * parent.paintedHeight | ||
39 | height: width | 38 | height: width | ||
40 | source: Activity.url + "tPoint.svg" | 39 | source: Activity.url + "tPoint.svg" | ||
41 | sourceSize.width: width | 40 | sourceSize.width: width | ||
42 | sourceSize.height: width | 41 | sourceSize.height: width | ||
43 | antialiasing: true | 42 | antialiasing: true | ||
44 | 43 | | |||
45 | x: (parent.width - parent.paintedWidth) / 2 + posX * parent.paintedWidth - width / 2 | 44 | | ||
46 | y: (parent.height - parent.paintedHeight) / 2 + posY * parent.paintedHeight - height / 2 | 45 | x: ((parent.width - parent.paintedWidth) / 2) + posX * parent.paintedWidth - (width / 2) | ||
46 | y: ((parent.height - parent.paintedHeight) / 2)+ posY * parent.paintedHeight- (height / 2) | ||||
47 | 47 | | |||
48 | property double xCenter: terminalPoint.parent.x + terminalPoint.x + width/2 | 48 | property double xCenter: terminalPoint.parent.x + terminalPoint.x + width/2 | ||
49 | property double yCenter: terminalPoint.parent.y + terminalPoint.y + height/2 | 49 | property double yCenter: terminalPoint.parent.y + terminalPoint.y + height/2 | ||
50 | property double xCenterFromComponent: terminalPoint.x + width/2 - terminalPoint.parent.width / 2 | 50 | property double xCenterFromComponent: terminalPoint.x + width/2 - terminalPoint.parent.width / 2 | ||
51 | property double yCenterFromComponent: terminalPoint.y + height/2 - terminalPoint.parent.height / 2 | 51 | property double yCenterFromComponent: terminalPoint.y + height/2 - terminalPoint.parent.height / 2 | ||
52 | 52 | | |||
53 | Rectangle { | 53 | Rectangle { | ||
54 | id: boundary | 54 | id: boundary | ||
Show All 18 Lines |