mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-16 09:01:49 -05:00
Merge pull request #380 from vsonnier/text_zones_adjustments
Fix for large dB values displayed with truncation on the left if > Normal zoom level, and misc.
This commit is contained in:
commit
f2f8b311ef
@ -103,8 +103,8 @@ AppFrame::AppFrame() :
|
|||||||
demodModeSelectorAdv->addChoice("QAM");
|
demodModeSelectorAdv->addChoice("QAM");
|
||||||
demodModeSelectorAdv->addChoice("QPSK");
|
demodModeSelectorAdv->addChoice("QPSK");
|
||||||
demodModeSelectorAdv->setHelpTip("Choose advanced modulation types.");
|
demodModeSelectorAdv->setHelpTip("Choose advanced modulation types.");
|
||||||
demodModeSelectorAdv->SetMinSize(wxSize(44,-1));
|
demodModeSelectorAdv->SetMinSize(wxSize(50,-1));
|
||||||
demodModeSelectorAdv->SetMaxSize(wxSize(44,-1));
|
demodModeSelectorAdv->SetMaxSize(wxSize(50,-1));
|
||||||
demodTray->Add(demodModeSelectorAdv, 3, wxEXPAND | wxALL, 0);
|
demodTray->Add(demodModeSelectorAdv, 3, wxEXPAND | wxALL, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ void SpectrumPanel::drawPanelContents() {
|
|||||||
glLineWidth(1.0);
|
glLineWidth(1.0);
|
||||||
|
|
||||||
if (showDb) {
|
if (showDb) {
|
||||||
float dbPanelWidth = (1.0 / viewWidth)*75.0 * GLFont::getScaleFactor();
|
float dbPanelWidth = (1.0 / viewWidth)*88.0 * GLFont::getScaleFactor();
|
||||||
float dbPanelHeight = (1.0/viewHeight)*14.0 * GLFont::getScaleFactor();
|
float dbPanelHeight = (1.0/viewHeight)*14.0 * GLFont::getScaleFactor();
|
||||||
|
|
||||||
|
|
||||||
|
@ -404,16 +404,29 @@ void GLTextPanel::drawPanelContents() {
|
|||||||
//pdimy is considered un-scaled
|
//pdimy is considered un-scaled
|
||||||
pdimy = round(pdimy / appliedScaleFactor);
|
pdimy = round(pdimy / appliedScaleFactor);
|
||||||
|
|
||||||
//target font size: a bit smaller than pdimy:
|
int size = 12;
|
||||||
int sz = 12;
|
|
||||||
|
|
||||||
if (pdimy > 14) {
|
if (pdimy <= 16) {
|
||||||
//make the font a little smaller that the TextPanel
|
|
||||||
sz = pdimy - 2;
|
|
||||||
|
|
||||||
|
size = 12;
|
||||||
|
} else if (pdimy <= 18) {
|
||||||
|
|
||||||
|
size = 16;
|
||||||
|
} else if(pdimy <= 24) {
|
||||||
|
|
||||||
|
size = 18;
|
||||||
|
} else if(pdimy <= 32) {
|
||||||
|
|
||||||
|
size = 24;
|
||||||
|
} else if(pdimy <= 48) {
|
||||||
|
|
||||||
|
size = 32;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
size = 48;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFont::getFont(sz, appliedScaleFactor).drawString(textVal, mid, mid, horizAlign, vertAlign, (int)pdim.x, (int)pdim.y);
|
GLFont::getFont(size, appliedScaleFactor).drawString(textVal, mid, mid, horizAlign, vertAlign, (int)pdim.x, (int)pdim.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLTextPanel::setText(std::string text, GLFont::Align hAlign, GLFont::Align vAlign, bool useNative) {
|
void GLTextPanel::setText(std::string text, GLFont::Align hAlign, GLFont::Align vAlign, bool useNative) {
|
||||||
|
@ -851,7 +851,8 @@ GLFont::Drawer::Drawer(int basicFontSize, double scaleFactor) {
|
|||||||
//final font size of basicFontSize* scaleFactor:
|
//final font size of basicFontSize* scaleFactor:
|
||||||
renderingFontIndex = 0;
|
renderingFontIndex = 0;
|
||||||
|
|
||||||
double targetSize = basicFontSize * scaleFactor;
|
//try to align on an integer pixel size if the targetSize font is available
|
||||||
|
int targetSize = round(basicFontSize * scaleFactor);
|
||||||
|
|
||||||
fonts[0].loadFontOnce();
|
fonts[0].loadFontOnce();
|
||||||
|
|
||||||
@ -869,10 +870,10 @@ GLFont::Drawer::Drawer(int basicFontSize, double scaleFactor) {
|
|||||||
} //end for
|
} //end for
|
||||||
|
|
||||||
//
|
//
|
||||||
double rawSize = fonts[renderingFontIndex].pixHeight;
|
int rawSize = fonts[renderingFontIndex].pixHeight;
|
||||||
|
|
||||||
//targetSize may not be reached yet, so the effective rendering font: fonts[renderingFontIndex] must be scaled up a bit.
|
//targetSize may not be reached yet, so the effective rendering font: fonts[renderingFontIndex] must be scaled up a bit.
|
||||||
renderingFontScaleFactor = targetSize / rawSize;
|
renderingFontScaleFactor = (double) targetSize / rawSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLFont::Drawer::drawString(const std::wstring& str, float xpos, float ypos, Align hAlign, Align vAlign, int vpx, int vpy, bool cacheable) {
|
void GLFont::Drawer::drawString(const std::wstring& str, float xpos, float ypos, Align hAlign, Align vAlign, int vpx, int vpy, bool cacheable) {
|
||||||
|
Loading…
Reference in New Issue
Block a user