Fixed atmosphere daytime control binding

This commit is contained in:
Michaël Lemaire 2015-08-19 01:18:16 +02:00
parent 9d077d78f5
commit 95d2f55ebf
3 changed files with 22 additions and 2 deletions

View file

@ -61,14 +61,17 @@ void ModelerCameras::processPanning(double xvalue, double yvalue)
void ModelerCameras::timerEvent(QTimerEvent *) void ModelerCameras::timerEvent(QTimerEvent *)
{ {
current->transitionToAnother(active, 0.3); current->transitionToAnother(active, 0.3);
parent->getScenery()->keepCameraAboveGround(current);
parent->getRenderer()->setCamera(current); parent->getRenderer()->setCamera(current);
} }
void ModelerCameras::validate() void ModelerCameras::validate()
{ {
parent->getScenery()->keepCameraAboveGround(current);
parent->getScenery()->keepCameraAboveGround(active); parent->getScenery()->keepCameraAboveGround(active);
parent->getScenery()->keepCameraAboveGround(current);
parent->getRenderer()->setCamera(current);
if (active == render) { if (active == render) {
parent->getScenery()->setCamera(active); parent->getScenery()->setCamera(active);
} }

View file

@ -20,6 +20,16 @@ Item {
anchors.fill: parent anchors.fill: parent
} }
onValueChanged: {
for (var i = 0; i < children.length; i++)
{
if (children[i].value == value)
{
choice_group.current = children[i];
}
}
}
onChildrenChanged: { onChildrenChanged: {
for (var i = 0; i < children.length; i++) for (var i = 0; i < children.length; i++)
{ {

View file

@ -9,7 +9,14 @@ BasePanel {
default property real value: day_night.value == 2 ? 1.0 : slider.value * 0.54 + 0.23; default property real value: day_night.value == 2 ? 1.0 : slider.value * 0.54 + 0.23;
signal changed(real value) signal changed(real value)
onValueChanged: changed(value) onValueChanged: {
changed(value);
day_night.value = (value >= 0.23 && value <= 0.77) ? 1 : 2;
if (day_night.value == 1)
{
slider.value = (value - 0.23) / 0.54;
}
}
ColumnLayout ColumnLayout
{ {