diff --git a/include/eepp/scene/node.hpp b/include/eepp/scene/node.hpp index 9473a86e0..eb02501a7 100644 --- a/include/eepp/scene/node.hpp +++ b/include/eepp/scene/node.hpp @@ -97,7 +97,7 @@ class EE_API Node : public Transformable { virtual const Sizef& getSize() const; - virtual const Sizef& getPixelsSize() const; + const Sizef& getPixelsSize() const; Node * setVisible( const bool& visible ); diff --git a/include/eepp/ui/uigridlayout.hpp b/include/eepp/ui/uigridlayout.hpp index b7cb9a345..4cd8a0715 100644 --- a/include/eepp/ui/uigridlayout.hpp +++ b/include/eepp/ui/uigridlayout.hpp @@ -69,7 +69,7 @@ class EE_API UIGridLayout : public UILayout { virtual Uint32 onMessage( const NodeMessage * Msg ); - Sizef getTargetElementSize(); + Sizef getTargetElementSize() const; void pack(); }; diff --git a/include/eepp/ui/uinode.hpp b/include/eepp/ui/uinode.hpp index 1bbcb776a..f643dbdf7 100644 --- a/include/eepp/ui/uinode.hpp +++ b/include/eepp/ui/uinode.hpp @@ -73,8 +73,6 @@ class EE_API UINode : public Node { const Sizef& getSize() const; - virtual const Sizef& getPixelsSize() const; - Rect getRect() const; virtual void draw(); diff --git a/include/eepp/ui/uiscenenode.hpp b/include/eepp/ui/uiscenenode.hpp index c3a29d8b5..5efa9dd1c 100644 --- a/include/eepp/ui/uiscenenode.hpp +++ b/include/eepp/ui/uiscenenode.hpp @@ -20,9 +20,7 @@ class EE_API UISceneNode : public SceneNode { virtual Node * setSize( const Float& Width, const Float& Height ); - const Sizef& getSize(); - - virtual const Sizef& getPixelsSize(); + const Sizef& getSize() const; void setTranslator( Translator translator ); diff --git a/src/eepp/scene/node.cpp b/src/eepp/scene/node.cpp index ea19cc729..c027785ef 100644 --- a/src/eepp/scene/node.cpp +++ b/src/eepp/scene/node.cpp @@ -155,7 +155,7 @@ const Sizef& Node::getSize() const { } const Sizef& Node::getPixelsSize() const { - return getSize(); + return mSize; } Node * Node::setVisible( const bool& visible ) { diff --git a/src/eepp/ui/css/stylesheet.cpp b/src/eepp/ui/css/stylesheet.cpp index 4349c8223..7acbd004b 100644 --- a/src/eepp/ui/css/stylesheet.cpp +++ b/src/eepp/ui/css/stylesheet.cpp @@ -46,10 +46,6 @@ void StyleSheet::combineStyleSheet( const StyleSheet& styleSheet ) { StyleSheet::StyleSheetPseudoClassProperties StyleSheet::getElementProperties( StyleSheetElement * element ) { StyleSheetPseudoClassProperties propertiesSelectedByPseudoClass; - int c = 0; - if ( element->getStyleSheetId() == "lvbox" ) { - c++; - } for ( auto it = mNodes.begin(); it != mNodes.end(); ++it ) { StyleSheetNode& node = it->second; @@ -58,9 +54,9 @@ StyleSheet::StyleSheetPseudoClassProperties StyleSheet::getElementProperties( St if ( selector.matches( element ) ) { for ( auto pit = node.getProperties().begin(); pit != node.getProperties().end(); ++pit ) { StyleSheetProperties& pseudoClassProperties = propertiesSelectedByPseudoClass[selector.getPseudoClass()]; - auto it = pseudoClassProperties.find( pit->second.getName() ); + auto pcit = pseudoClassProperties.find( pit->second.getName() ); - if ( it == pseudoClassProperties.end() || pit->second.getSpecificity() >= it->second.getSpecificity() ) { + if ( pcit == pseudoClassProperties.end() || pit->second.getSpecificity() >= pcit->second.getSpecificity() ) { pseudoClassProperties[ pit->second.getName() ] = pit->second; } } diff --git a/src/eepp/ui/uigridlayout.cpp b/src/eepp/ui/uigridlayout.cpp index f436e7985..84c83f4d6 100644 --- a/src/eepp/ui/uigridlayout.cpp +++ b/src/eepp/ui/uigridlayout.cpp @@ -199,7 +199,7 @@ Uint32 UIGridLayout::onMessage(const NodeMessage * Msg) { return 0; } -Sizef UIGridLayout::getTargetElementSize() { +Sizef UIGridLayout::getTargetElementSize() const { return Sizef( mColumnMode == Size ? mColumnWidth : ( ( getLayoutHeightRules() == WRAP_CONTENT ? getParent()->getSize().getWidth() : mDpSize.getWidth() ) - mPadding.Left - mPadding.Right ) * mColumnWeight, mRowMode == Size ? mRowHeight : ( ( getLayoutHeightRules() == WRAP_CONTENT ? getParent()->getSize().getHeight() : mDpSize.getHeight() ) - mPadding.Top - mPadding.Bottom ) * mRowWeight ); } diff --git a/src/eepp/ui/uinode.cpp b/src/eepp/ui/uinode.cpp index 7af95a8e9..2b377afa0 100644 --- a/src/eepp/ui/uinode.cpp +++ b/src/eepp/ui/uinode.cpp @@ -203,10 +203,6 @@ const Sizef& UINode::getSize() const { return mDpSize; } -const Sizef& UINode::getPixelsSize() const { - return mSize; -} - void UINode::drawHighlightFocus() { if ( NULL != getEventDispatcher() && mSceneNode->getHighlightFocus() && getEventDispatcher()->getFocusControl() == this ) { Primitives P; diff --git a/src/eepp/ui/uiscenenode.cpp b/src/eepp/ui/uiscenenode.cpp index f95cdca2b..50759882c 100644 --- a/src/eepp/ui/uiscenenode.cpp +++ b/src/eepp/ui/uiscenenode.cpp @@ -261,14 +261,10 @@ Node * UISceneNode::setSize(const Float & Width, const Float & Height) { return setSize( Vector2f( Width, Height ) ); } -const Sizef &UISceneNode::getSize() { +const Sizef &UISceneNode::getSize() const { return mDpSize; } -const Sizef &UISceneNode::getPixelsSize() { - return mSize; -} - const bool& UISceneNode::isLoading() const { return mIsLoading; }