From 9dfbaa556667d47c9d035dfcb420323b0434fc45 Mon Sep 17 00:00:00 2001 From: John Rassa Date: Mon, 7 Oct 2019 22:25:39 -0400 Subject: [PATCH] fix assignment of gridtile theme properties --- es-core/src/components/GridTileComponent.cpp | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/es-core/src/components/GridTileComponent.cpp b/es-core/src/components/GridTileComponent.cpp index 889076ed4..ec7e329ea 100644 --- a/es-core/src/components/GridTileComponent.cpp +++ b/es-core/src/components/GridTileComponent.cpp @@ -60,36 +60,36 @@ void GridTileComponent::update(int deltaTime) resize(); } -void applyThemeToProperties(const ThemeData::ThemeElement* elem, GridTileProperties properties) +void applyThemeToProperties(const ThemeData::ThemeElement* elem, GridTileProperties* properties) { Vector2f screen = Vector2f((float)Renderer::getScreenWidth(), (float)Renderer::getScreenHeight()); if (elem->has("size")) - properties.mSize = elem->get("size") * screen; + properties->mSize = elem->get("size") * screen; if (elem->has("padding")) - properties.mPadding = elem->get("padding"); + properties->mPadding = elem->get("padding"); if (elem->has("imageColor")) - properties.mImageColor = elem->get("imageColor"); + properties->mImageColor = elem->get("imageColor"); if (elem->has("backgroundImage")) - properties.mBackgroundImage = elem->get("backgroundImage"); + properties->mBackgroundImage = elem->get("backgroundImage"); if (elem->has("backgroundCornerSize")) - properties.mBackgroundCornerSize = elem->get("backgroundCornerSize"); + properties->mBackgroundCornerSize = elem->get("backgroundCornerSize"); if (elem->has("backgroundColor")) { - properties.mBackgroundCenterColor = elem->get("backgroundColor"); - properties.mBackgroundEdgeColor = elem->get("backgroundColor"); + properties->mBackgroundCenterColor = elem->get("backgroundColor"); + properties->mBackgroundEdgeColor = elem->get("backgroundColor"); } if (elem->has("backgroundCenterColor")) - properties.mBackgroundCenterColor = elem->get("backgroundCenterColor"); + properties->mBackgroundCenterColor = elem->get("backgroundCenterColor"); if (elem->has("backgroundEdgeColor")) - properties.mBackgroundEdgeColor = elem->get("backgroundEdgeColor"); + properties->mBackgroundEdgeColor = elem->get("backgroundEdgeColor"); } void GridTileComponent::applyTheme(const std::shared_ptr& theme, const std::string& view, const std::string& /*element*/, unsigned int /*properties*/) @@ -99,7 +99,7 @@ void GridTileComponent::applyTheme(const std::shared_ptr& theme, cons // Apply theme to the default gridtile const ThemeData::ThemeElement* elem = theme->getElement(view, "default", "gridtile"); if (elem) - applyThemeToProperties(elem, mDefaultProperties); + applyThemeToProperties(elem, &mDefaultProperties); // Apply theme to the selected gridtile // NOTE that some of the default gridtile properties influence on the selected gridtile properties @@ -112,7 +112,7 @@ void GridTileComponent::applyTheme(const std::shared_ptr& theme, cons mSelectedProperties.mBackgroundCornerSize = mDefaultProperties.mBackgroundCornerSize; if (elem) - applyThemeToProperties(elem, mSelectedProperties); + applyThemeToProperties(elem, &mSelectedProperties); } // Made this a static function because the ImageGridComponent need to know the default tile size @@ -320,4 +320,4 @@ void GridTileComponent::forceSize(Vector2f size, float selectedZoom) { mDefaultProperties.mSize = size; mSelectedProperties.mSize = size * selectedZoom; -} \ No newline at end of file +}