The quest continues, almost done, but have an idea to rework GLFont.drawString() completly, TODO next time

This commit is contained in:
vsonnier
2016-06-22 21:21:32 +02:00
parent 9962e606a6
commit 83b62cddeb
8 changed files with 49 additions and 20 deletions
+6 -4
View File
@@ -116,7 +116,7 @@ void GainCanvas::SetLevel() {
gainInfo[panelHit]->levelPanel.setPosition(0.0, (-1.0+(hitResult.y)));
gainInfo[panelHit]->current = round(gainInfo[panelHit]->low+(hitResult.y * (gainInfo[panelHit]->high-gainInfo[panelHit]->low)));
gainInfo[panelHit]->changed = true;
gainInfo[panelHit]->valuePanel.setText(std::to_string(int(gainInfo[panelHit]->current)));
gainInfo[panelHit]->valuePanel.setText(std::to_string(int(gainInfo[panelHit]->current)),GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, true);
}
}
@@ -179,7 +179,7 @@ void GainCanvas::OnMouseWheelMoved(wxMouseEvent& event) {
gInfo->levelPanel.setSize(1.0, levelVal);
gInfo->levelPanel.setPosition(0.0, levelVal-1.0);
gInfo->valuePanel.setText(std::to_string(int(gInfo->current)));
gInfo->valuePanel.setText(std::to_string(int(gInfo->current)),GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, true);
}
}
@@ -290,14 +290,16 @@ void GainCanvas::updateGainUI() {
gInfo->labelPanel.setSize(spacing/2.0,(15.0/float(ClientSize.y)));
gInfo->labelPanel.setPosition(midPos, -barHeight-(20.0/float(ClientSize.y)));
gInfo->labelPanel.setText(gi->first);
gInfo->labelPanel.setText(gi->first,GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, true);
gInfo->labelPanel.setFill(GLPanel::GLPANEL_FILL_NONE);
bgPanel.addChild(&(gInfo->labelPanel));
gInfo->valuePanel.setSize(spacing/2.0,(15.0/float(ClientSize.y)));
gInfo->valuePanel.setPosition(midPos, barHeight+(20.0/float(ClientSize.y)));
gInfo->valuePanel.setText(std::to_string(int(gInfo->current)));
gInfo->valuePanel.setText(std::to_string(int(gInfo->current)), GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER, true);
gInfo->valuePanel.setFill(GLPanel::GLPANEL_FILL_NONE);
bgPanel.addChild(&(gInfo->valuePanel));
+4 -3
View File
@@ -29,10 +29,10 @@ void ModeSelectorContext::DrawSelector(std::string label, int c, int cMax, bool
float viewHeight = (float) vp[3];
float viewWidth = (float) vp[2];
GLFont::GLFontSize fontSize = GLFont::GLFONT_SIZE16;
GLFont::GLFontSize fontSize = GLFont::GLFONT_SIZE18;
if (viewWidth < 30 || viewHeight < 200) {
fontSize = GLFont::GLFONT_SIZE12;
fontSize = GLFont::GLFONT_SIZE16;
}
glColor4f(r, g, b, a);
@@ -59,7 +59,8 @@ void ModeSelectorContext::DrawSelector(std::string label, int c, int cMax, bool
glColor4f(0, 0, 0, a);
}
GLFont::getFont(fontSize).drawString(label, 0.0, y + height / 2.0, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER);
//Do not zoom the selectors
GLFont::getRawFont(fontSize).drawString(label, 0.0, y + height / 2.0, GLFont::GLFONT_ALIGN_CENTER, GLFont::GLFONT_ALIGN_CENTER);
}
void ModeSelectorContext::DrawEnd() {
+2 -1
View File
@@ -94,7 +94,8 @@ void TuningContext::DrawTuner(long long freq, int count, float displayPos, float
int numChars = freqChars.length();
int ofs = count - numChars;
GLFont& refDrawingFont = GLFont::getFont(fontSize);
//do not zoom this one:
GLFont& refDrawingFont = GLFont::getRawFont(fontSize);
for (int i = ofs; i < count; i++) {
float xpos = displayPos + (displayWidth / (float) count) * (float) i + ((displayWidth / 2.0) / (float) count);