Skip to content

Commit

Permalink
fix for label components not respecting alignment settings
Browse files Browse the repository at this point in the history
  • Loading branch information
braitsch committed Feb 9, 2016
1 parent 9ab2545 commit 3bbb159
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/components/ofxDatGuiLabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class ofxDatGuiLabel : public ofxDatGuiComponent{
void setWidth(int width, float labelWidth = 1)
{
ofxDatGuiComponent::setWidth(width, labelWidth);
mLabel.width = mStyle.width;
mLabel.rightAlignedXpos = mLabel.width - mLabel.margin;
ofxDatGuiComponent::positionLabel();
}

void draw()
Expand Down
3 changes: 2 additions & 1 deletion src/core/ofxDatGuiComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ void ofxDatGuiComponent::setBorderVisible(bool visible)

void ofxDatGuiComponent::update(bool acceptEvents)
{
if (acceptEvents && mEnabled){
// if window does not have focus x & y will both be zero //
if (acceptEvents && mEnabled && ofGetMouseX() != 0 && ofGetMouseY() != 0){
bool mp = ofGetMousePressed();
ofPoint mouse = ofPoint(ofGetMouseX() - mParentPosition.x, ofGetMouseY() - mParentPosition.y);
if (hitTest(mouse)){
Expand Down

0 comments on commit 3bbb159

Please sign in to comment.