Browse Source

Fix TextureMappingState::draw(), surfaces moving along with the texture

master
Krisjanis Rijnieks 9 years ago
parent
commit
4cd2d0926a
  1. 15
      src/Application/States/TextureMappingState.cpp

15
src/Application/States/TextureMappingState.cpp

@ -29,16 +29,26 @@ void TextureMappingState::draw(Application * app){
if(_drawMode == 0){ // Semi-transparent surfaces on front
drawTexture(app);
ofPopMatrix();
ofPushStyle();
ofSetColor(255, 255, 255, 150);
app->getSurfaceManager()->draw();
ofPopStyle();
ofPushMatrix();
ofTranslate(_canvasTranslate.x, _canvasTranslate.y);
}else if(_drawMode == 1){ // Opaque surfaces on front
drawTexture(app);
ofPopMatrix();
ofPushStyle();
ofSetColor(255, 255, 255, 255);
app->getSurfaceManager()->draw();
ofPopStyle();
ofPushMatrix();
ofTranslate(_canvasTranslate.x, _canvasTranslate.y);
}else if(_drawMode == 2){ // Draw texture only
ofTranslate(_canvasTranslate.x, _canvasTranslate.y);
drawTexture(app);
@ -47,8 +57,13 @@ void TextureMappingState::draw(Application * app){
}
if(_drawMode != 2){
ofPopMatrix();
Gui::instance()->getSurfaceHighlightWidget().setSurfaceManager(app->getSurfaceManager());
Gui::instance()->getSurfaceHighlightWidget().draw();
ofPushMatrix();
ofTranslate(_canvasTranslate.x, _canvasTranslate.y);
}
Gui::instance()->getTextureHighlightWidget().setSurfaceManager(app->getSurfaceManager());

Loading…
Cancel
Save