drawText ellipsis flag not working

projucer
gui

#1

Hello, i am building the GraphicsTurorial
(https://juce.com/doc/tutorial_graphics_class) and when i tried using the drawText(x, y, height, width, ellipsis flag) figured out that when i put false in ellipsis flag, it does not work. three dots still appear.

void MainComponent::paint (Graphics& g)
     g.fillAll (Colours::lightblue);
     g.setColour (Colours::darkblue);

//Set Fonts
Font mainComponentFont("Times New Roman", 20.0f, Font::italic);
g.setFont(mainComponentFont);

g.drawText("Hellow, World", 20, 40, 50, 40, false);}

what i see when running the app is: temp

does anyone have come across such a bug?


#2

Looks like user error. The API you are calling takes 7 parameters, with the 7th being the ellipse flag. You are inadvertently passing in ‘false’ for the Justification param.

void drawText (const String &text, int x, int y, int width, int height, Justification justificationType, bool useEllipsesIfTooBig=true)


#3

You are right! thank you
so it seem that tutorial has a mistake because i copy/pasted it


#4

or the API changed since the tutorial was written.


#5

Will make sure the tutorial gets updated, thanks for spotting that!


#6

thank you for the tutorials!


#7

You should thank @martinrobinson for these amazing tutorials!


#8

Ironically, I’m pretty sure @timur wrote that particular one!