Skip to content

Commit

Permalink
Fixed light gui component inspector (#1337)
Browse files Browse the repository at this point in the history
Signed-off-by: ahcorde <ahcorde@gmail.com>
  • Loading branch information
ahcorde committed Feb 15, 2022
1 parent bcb1a36 commit 211289f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/gui/plugins/component_inspector/Light.qml
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ Rectangle {
}
RowLayout {
Text {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
Layout.columnSpan: 6
text: " Direction"
color: "dimgrey"
Expand All @@ -882,7 +882,7 @@ Rectangle {
}
RowLayout {
Rectangle {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
color: "transparent"
height: 40
Layout.preferredWidth: xDirectionText.width + indentation*3
Expand All @@ -896,7 +896,7 @@ Rectangle {
Component.onCompleted: loaderDirectionX.item.componentInfo = "directionX"

Text {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
id : xDirectionText
text: ' X:'
leftPadding: 5
Expand All @@ -906,7 +906,7 @@ Rectangle {
}
}
Item {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
Layout.fillWidth: true
height: 40
Layout.columnSpan: 4
Expand All @@ -923,7 +923,7 @@ Rectangle {
}
RowLayout {
Rectangle {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
color: "transparent"
height: 40
Layout.preferredWidth: yDirectionText.width + indentation*3
Expand All @@ -937,7 +937,7 @@ Rectangle {
Component.onCompleted: loaderDirectionY.item.componentInfo = "directionY"

Text {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
id : yDirectionText
text: ' Y:'
leftPadding: 5
Expand All @@ -947,7 +947,7 @@ Rectangle {
}
}
Item {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
Layout.fillWidth: true
height: 40
Layout.columnSpan: 4
Expand All @@ -964,7 +964,7 @@ Rectangle {
}
RowLayout {
Rectangle {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
color: "transparent"
height: 40
Layout.preferredWidth: zDirectionText.width + indentation*3
Expand All @@ -978,7 +978,7 @@ Rectangle {
Component.onCompleted: loaderDirectionZ.item.componentInfo = "directionZ"

Text {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
id : zDirectionText
text: ' Z:'
leftPadding: 5
Expand All @@ -988,7 +988,7 @@ Rectangle {
}
}
Item {
visible: model.data[19] === 1 || model.data[19] === 2
visible: model.data[20] === 1 || model.data[20] === 2
Layout.fillWidth: true
height: 40
Layout.columnSpan: 4
Expand All @@ -1005,7 +1005,7 @@ Rectangle {
}
RowLayout {
Text {
visible: model.data[19] === 1
visible: model.data[20] === 1
Layout.columnSpan: 6
text: " Spot features"
color: "dimgrey"
Expand All @@ -1014,7 +1014,7 @@ Rectangle {
}
RowLayout {
Rectangle {
visible: model.data[19] === 1
visible: model.data[20] === 1
color: "transparent"
height: 40
Layout.preferredWidth: innerAngleText.width + indentation*3
Expand All @@ -1028,7 +1028,7 @@ Rectangle {
Component.onCompleted: loaderInnerAngle.item.componentInfo = "innerAngle"

Text {
visible: model.data[19] === 1
visible: model.data[20] === 1
id : innerAngleText
text: ' Inner Angle:'
leftPadding: 5
Expand All @@ -1038,7 +1038,7 @@ Rectangle {
}
}
Item {
visible: model.data[19] === 1
visible: model.data[20] === 1
Layout.fillWidth: true
height: 40
Layout.columnSpan: 4
Expand All @@ -1055,7 +1055,7 @@ Rectangle {
}
RowLayout {
Rectangle {
visible: model.data[19] === 1
visible: model.data[20] === 1
color: "transparent"
height: 40
Layout.preferredWidth: outerAngleText.width + indentation*3
Expand All @@ -1069,7 +1069,7 @@ Rectangle {
Component.onCompleted: loaderOuterAngle.item.componentInfo = "outerAngle"

Text {
visible: model.data[19] === 1
visible: model.data[20] === 1
id : outerAngleText
text: ' Outer angle:'
leftPadding: 5
Expand All @@ -1079,7 +1079,7 @@ Rectangle {
}
}
Item {
visible: model.data[19] === 1
visible: model.data[20] === 1
Layout.fillWidth: true
height: 40
Layout.columnSpan: 4
Expand All @@ -1096,7 +1096,7 @@ Rectangle {
}
RowLayout {
Rectangle {
visible: model.data[19] === 1
visible: model.data[20] === 1
color: "transparent"
height: 40
Layout.preferredWidth: fallOffText.width + indentation*3
Expand All @@ -1110,7 +1110,7 @@ Rectangle {
Component.onCompleted: loaderFallOff.item.componentInfo = "falloff"

Text {
visible: model.data[19] === 1
visible: model.data[20] === 1
id : fallOffText
text: ' Falloff:'
leftPadding: 5
Expand All @@ -1120,7 +1120,7 @@ Rectangle {
}
}
Item {
visible: model.data[19] === 1
visible: model.data[20] === 1
Layout.fillWidth: true
height: 40
Layout.columnSpan: 4
Expand Down
6 changes: 6 additions & 0 deletions src/rendering/RenderUtil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2131,6 +2131,12 @@ void RenderUtilPrivate::UpdateLights(
auto l = std::dynamic_pointer_cast<rendering::Light>(node);
if (l)
{
if (!ignition::math::equal(
l->Intensity(),
static_cast<double>(light.second.intensity())))
{
l->SetIntensity(light.second.intensity());
}
if (light.second.has_diffuse())
{
if (l->DiffuseColor() != msgs::Convert(light.second.diffuse()))
Expand Down

0 comments on commit 211289f

Please sign in to comment.