Skip to content

Commit

Permalink
fix for Windows regarding ABSOLUTE enum #43
Browse files Browse the repository at this point in the history
  • Loading branch information
frauzufall committed Feb 9, 2017
1 parent 4511adb commit 8b0ea6a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/DOM/Types.h
Expand Up @@ -79,9 +79,9 @@ enum class LayoutFloat {
/// \brief The position type of a gui element in a layout.
enum class LayoutPosition {
/// \brief Element is positioned by the floating attribute depending of the positions of its siblings.
STATIC,
POSITION_STATIC,
/// \brief Element is positioned by its position independent of siblings.
ABSOLUTE
POSITION_ABSOLUTE
};

template <class T>
Expand Down
4 changes: 2 additions & 2 deletions src/ofxGuiElement.cpp
Expand Up @@ -84,7 +84,7 @@ void ofxGuiElement::setup(){
showName.set("show-name", true);
borderWidth.set("border-width", 1);
borderRadius.set("border-radius", 0);
setLayoutPosition(DOM::LayoutPosition::STATIC);
setLayoutPosition(DOM::LayoutPosition::POSITION_STATIC);

textAlignment.setName("text-align");
setTextAlignment("left");
Expand Down Expand Up @@ -571,7 +571,7 @@ void ofxGuiElement::setLayoutPosition(DOM::LayoutPosition type){

DOM::LayoutPosition ofxGuiElement::getLayoutPosition() {
if(!hasAttribute("position")){
setAttribute("position", DOM::LayoutPosition::STATIC);
setAttribute("position", DOM::LayoutPosition::POSITION_STATIC);
}
return getAttribute<DOM::LayoutPosition>("position");
}
Expand Down
4 changes: 2 additions & 2 deletions src/view/JsonConfigParser.cpp
Expand Up @@ -168,11 +168,11 @@ bool JsonConfigParser::_parse(const ofJson &config, const string &name, DOM::Lay
if (config.find(name) != config.end()) {
ofJson content = config[name];
if(content == "static"){
val = DOM::LayoutPosition::STATIC;
val = DOM::LayoutPosition::POSITION_STATIC;
return true;
}
if(content == "absolute"){
val = DOM::LayoutPosition::ABSOLUTE;
val = DOM::LayoutPosition::POSITION_ABSOLUTE;
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/view/ofxDOMFlexBoxLayout.cpp
Expand Up @@ -413,7 +413,7 @@ bool ofxDOMFlexBoxLayout::elementFlexing(DOM::Element* e){
return false;
}
if(e->hasAttribute("position")){
if(e->getAttribute<DOM::LayoutPosition>("position") == DOM::LayoutPosition::ABSOLUTE){
if(e->getAttribute<DOM::LayoutPosition>("position") == DOM::LayoutPosition::POSITION_ABSOLUTE){
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/view/ofxDOMLayoutHelper.cpp
Expand Up @@ -13,7 +13,7 @@ bool ofxDOMLayoutHelper::elementAbsolutePositioned(DOM::Element* e){
return false;
}
if(e->hasAttribute("position")){
if(e->getAttribute<DOM::LayoutPosition>("position") == DOM::LayoutPosition::ABSOLUTE){
if(e->getAttribute<DOM::LayoutPosition>("position") == DOM::LayoutPosition::POSITION_ABSOLUTE){
return true;
}
}
Expand Down

0 comments on commit 8b0ea6a

Please sign in to comment.