Bloc
Bloc copied to clipboard
Need to draw a border to a BlRopedTExt
The purpose is to add a border with a different color than foreground to a BlTextElement such as here (for sample):
We need to set basic parameters of the border such as thickness (width) and color.
@tinchodias this is our tomorrow discussion :-)
Hello, I made it work with an attribute, that allows user to send border: to a roped text, so it can be specified for a sub-sequence of the text like this:
Code:
aText := 'BlocBloc' asRopedText.
aText fontSize: 250.
(Color wheel: aText size) withIndexDo: [ :aColor :index |
(aText from: index to: index) background: aColor ].
(aText from: 1 to: 3)
foreground: Color white;
border: (BlBorder builder
paint: Color black;
width: 10;
dashArray: #(20 20);
capSquare;
build).
(aText from: 5 to: 7)
foreground: Color black;
border: (BlBorder builder
paint: Color white;
width: 10;
dashArray: #(20 20);
capRound;
build).
element := BlTextElement new
text: aText;
position: 20 asPoint;
background: Color gray;
yourself.
aSpace := BlSpace new.
aSpace root
addChild: element;
background: Color darkGray.
aSpace extent: 1000 @ 300.
aSpace show.
Do you think this is good for your needs? @labordep @LANDAISB
Hello, Yes it seems very good. Thank you.
In which branch can we test this ?
Thanks @tinchodias!
I have to clean up a bit and push it. Notes:
- It can be extended easily to have outskirts (it's a separate object that BlElement points directly, I mean the BlBorder doesn't know about outskirts)
- Right now it is rendered only above the text, but it could be changed easily to be below it. Do we keep that for other moment, or do you prefer to have this options?
These options are intersting, but we do not need them for the moment. So I think you can postpone these options.
yes but if the gap to have then finished work is not too expensive, I think that the better is to do it now.