Draw Issues | VSTGUI4 | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Draw Issues
Avatar
Member
Members
January 1, 2021 - 10:55 pm
Member Since: February 21, 2020
Forum Posts: 56
sp_UserOfflineSmall Offline

I am using a custom class that extends CTextButton using this DRAW function override function posted below. In mac this is centred in the middle but is cutoff in the windows iteration.  Is there something I am not implementing or is this something I need to do mysellf using IF WIN? 

Thanks in advanced if anyone knows! 

void MeterLabel::draw(CDrawContext* context)
{
bool highlight = value > 0.5 ? true : false;
context->setDrawMode(kAntiAliasing);
context->setLineWidth(frameWidth);

//PD-Hold-S
if (maxHold == true)
{
if ((getValue()) > getMaxPeak())
{
setMaxPeak(getValue());
}
}
else
{
setMaxPeak(getValue());
}
//PD-Hold-S

//--- convert to dB
float yt = 20 * log10(getMaxPeak() * 100);

//--- perform 00.00 String instead of 00.00000000000
std::stringstream stream;
stream << std::fixed << std::setprecision(1) << yt;
s = stream.str();

if (getMaxPeak()*100.0 < 0.001)
{
s = "-INF";
}

CRect r = (getViewSize()); //declares a rectangle the size of the view

CBitmap* iconToDraw = highlight ? (iconHighlighted ? iconHighlighted : icon) : (icon ? icon : iconHighlighted);
CDrawMethods::drawIconAndText(context, iconToDraw, iconPosition, getTextAlignment(), getTextMargin(), r, s, getFont(), highlight ? getTextColorHighlighted() : getTextColor());
setDirty(false);
}

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Chaes: 56

Skyler: 48

StevieD: 46

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

Nickolai: 43

clau_ste: 39

jeanlecode: 37

Member Stats:

Guest Posters: 1

Members: 768

Moderators: 1

Admins: 6

Forum Stats:

Groups: 13

Forums: 42

Topics: 842

Posts: 3347

Moderators: W Pirkle: 689