MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / generateZLevel

Method generateZLevel

src/domain/UBGraphicsScene.cpp:108–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108qreal UBZLayerController::generateZLevel(itemLayerType::Enum key)
109{
110
111 if (!scopeMap.contains(key)) {
112 qDebug() << "Number is out of layer scope";
113 return errorNumber;
114 }
115
116 qreal result = scopeMap.value(key).curValue;
117 qreal top = scopeMap.value(key).topLimit;
118 qreal incrementalStep = scopeMap.value(key).incStep;
119
120 result += incrementalStep;
121 if (result >= top) {
122 // If not only one variable presents in the scope, notify that values for scope are over
123 if (scopeMap.value(key).topLimit != scopeMap.value(key).bottomLimit) {
124 qDebug() << "new values are over for the scope" << key;
125 }
126 result = top - incrementalStep;
127 }
128
129 scopeMap[key].curValue = result;
130
131 return result;
132}
133qreal UBZLayerController::generateZLevel(QGraphicsItem *item)
134{
135 qreal result = errorNumber;

Callers 4

addItemMethod · 0.80
foreachFunction · 0.80
setAsBackgroundObjectMethod · 0.80
setSelectedZLevelMethod · 0.80

Calls 4

validLayerTypeFunction · 0.85
containsMethod · 0.45
valueMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected