Hello everyone! Im trying use the balloon canvas to draw some nice smooth anti aliased lines, but now i seem to have hit upon a bug which i dont know how to fix. if i draw just lines i get everything i want.  but if i add a âdrawString:â¦â in there at any point, all the lines i try to draw subsequently dont show up. Here is code that shows the exact issue:
form := Form extent: 100@100 depth: 32. form fillWhite. canvas := BalloonCanvas on: form. canvas aaLevel: 4. "canvas := FormCanvas on: form." points := { {10@10 . 50@43} . {50@42 . 90@75} . {90@75 . 50@90 } }.
points do: [ :p |   canvas drawPolygon: p    color: Color transparent    borderWidth: 1    borderColor: Color red.
  canvas drawString: p first asString    at: p first    font: nil    color: Color green. ].
morph := ImageMorph new. morph image: form. morph openCenteredInWorld.
if i comment out the canvas drawstring i get what you would expect: a squiggly line. if i add in the drawstring, the first line shows up but all the subsequent lines do not get drawn. Â (both images attached) I spent a bunch of time tracking it down to its most purest form and then a bunch of time debugging it and im out of my depth with the baloon code, i cant seem to figure out whats wrong. Â if anyone knows whats wrong or can give me a clue on how to fix it iâd greatly appreciate it. thanks in advance. { jb }
I don't think anybody within Pharo use the balloon canvas. You should ask to the Squeak community, you will very likely have more support on that matter. Hilaire Le 06/04/2018 à 02:57, joe@boremaj.net a écrit :
Im trying use the balloon canvas to draw some nice smooth anti aliased lines, but now i seem to have hit upon a bug which i dont know how to fix.
-- Dr. Geo http://drgeo.eu
I tried on a recent Squeak system, still got a buggy out put but a bit surprisingly different! Hialire Le 06/04/2018 à 12:10, Hilaire a écrit :
I don't think anybody within Pharo use the balloon canvas. You should ask to the Squeak community, you will very likely have more support on that matter.
-- Dr. Geo http://drgeo.eu
hi, real question is why you use Balloon and not Athens :) cheers, Esteban
On 6 Apr 2018, at 12:14, Hilaire <hilaire@drgeo.eu> wrote:
I tried on a recent Squeak system, still got a buggy out put but a bit surprisingly different!
Hialire
Le 06/04/2018 à 12:10, Hilaire a écrit :
I don't think anybody within Pharo use the balloon canvas. You should ask to the Squeak community, you will very likely have more support on that matter.
-- Dr. Geo http://drgeo.eu
And the real^2 question: why do we still have balloon in the image if we should not use it?
On 6 Apr 2018, at 12:31, Esteban Lorenzano <estebanlm@gmail.com> wrote:
hi,
real question is why you use Balloon and not Athens :)
cheers, Esteban
On 6 Apr 2018, at 12:14, Hilaire <hilaire@drgeo.eu> wrote:
I tried on a recent Squeak system, still got a buggy out put but a bit surprisingly different!
Hialire
Le 06/04/2018 à 12:10, Hilaire a écrit :
I don't think anybody within Pharo use the balloon canvas. You should ask to the Squeak community, you will very likely have more support on that matter.
-- Dr. Geo http://drgeo.eu
Am 06.04.2018 um 12:58 schrieb Marcus Denker <marcus.denker@inria.fr>:
And the real^2 question: why do we still have balloon in the image if we should not use it?
+1 Norbert
On 6 Apr 2018, at 12:31, Esteban Lorenzano <estebanlm@gmail.com> wrote:
hi,
real question is why you use Balloon and not Athens :)
cheers, Esteban
On 6 Apr 2018, at 12:14, Hilaire <hilaire@drgeo.eu> wrote:
I tried on a recent Squeak system, still got a buggy out put but a bit surprisingly different!
Hialire
Le 06/04/2018 à 12:10, Hilaire a écrit :
I don't think anybody within Pharo use the balloon canvas. You should ask to the Squeak community, you will very likely have more support on that matter.
-- Dr. Geo http://drgeo.eu
Does { jb } want to deploy on tablet computer (Android or iOS) ? Le 06/04/2018 à 12:31, Esteban Lorenzano a écrit :
real question is why you use Balloon and not Athens:)
-- Dr. Geo http://drgeo.eu
No at least not right now. { jb } On Apr 6, 2018, 8:11 AM -0400, Hilaire <hilaire@drgeo.eu>, wrote:
Does { jb } want to deploy on tablet computer (Android or iOS) ?
Le 06/04/2018 à 12:31, Esteban Lorenzano a écrit :
real question is why you use Balloon and not Athens:)
-- Dr. Geo http://drgeo.eu
I must have missed the deprecation warnings when i ran my code. 8). Ill check out Athens, i donât want to have to rewrite the entire application to support a new drawing backend. As a first step it would be great if i could render to an Athens canvas using the same API or something like it, but in my quick experiments Iâve had no luck. Iâm sure Iâm doing something wrong. Is there any Athens tutorial documentation? All Iâve found is forum posts and videos and most of that stuff is quite old and there are a lot of broken links. { jb } On Apr 6, 2018, 6:32 AM -0400, Esteban Lorenzano <estebanlm@gmail.com>, wrote:
hi,
real question is why you use Balloon and not Athens :)
cheers, Esteban
Hi Joe, the problem is that the BalloonCanvas (or some objects it is using) aren't fully reset after some drawing operations. (the drawString method for example sets the sourceForm as glyph to be drawn). it should work if you do not store the canvas instance, but create a new in every loop: points do: [ :p | canvas := form getCanvas asBalloonCanvas aaLevel:4; yourself. canvas drawPolygon: p color: Color transparent borderWidth: 1 borderColor: Color red. canvas drawString: p first asString at: p first font: nil color: Color green. ]. Or just reset the engine state (but I don't like this solution, the engine state should be private to the canvas). points do: [ :p | canvas drawPolygon: p color: Color transparent borderWidth: 1 borderColor: Color red. canvas drawString: p first asString at: p first font: nil color: Color green. canvas resetEngine. ]. 2018-04-06 2:57 GMT+02:00 <joe@boremaj.net>:
Hello everyone!
Im trying use the balloon canvas to draw some nice smooth anti aliased lines, but now i seem to have hit upon a bug which i dont know how to fix.
if i draw just lines i get everything i want. but if i add a âdrawString:â¦â in there at any point, all the lines i try to draw subsequently dont show up.
Here is code that shows the exact issue:
form := Form extent: 100@100 depth: 32. form fillWhite. canvas := BalloonCanvas on: form. canvas aaLevel: 4. "canvas := FormCanvas on: form." points := { {10@10 . 50@43} . {50@42 . 90@75} . {90@75 . 50@90 } }.
points do: [ :p | canvas drawPolygon: p color: Color transparent borderWidth: 1 borderColor: Color red.
canvas drawString: p first asString at: p first font: nil color: Color green. ].
morph := ImageMorph new. morph image: form. morph openCenteredInWorld.
if i comment out the canvas drawstring i get what you would expect: a squiggly line.
if i add in the drawstring, the first line shows up but all the subsequent lines do not get drawn. (both images attached)
I spent a bunch of time tracking it down to its most purest form and then a bunch of time debugging it and im out of my depth with the baloon code, i cant seem to figure out whats wrong. if anyone knows whats wrong or can give me a clue on how to fix it iâd greatly appreciate it.
thanks in advance.
{ jb }
That worked, thank you so much! This helps me get running in the interim while i investigate how to use Athens. { jb } On Apr 6, 2018, 9:31 AM -0400, Nicolai Hess <nicolaihess@gmail.com>, wrote:
Hi Joe,
the problem is that the BalloonCanvas (or some objects it is using) aren't fully reset after some drawing operations. (the drawString method for example sets the sourceForm as glyph to be drawn).
it should work if you do not store the canvas instance, but create a new in every loop:
   points do: [ :p |
      canvas := form getCanvas asBalloonCanvas aaLevel:4; yourself.
      canvas drawPolygon: p          color: Color transparent          borderWidth: 1          borderColor: Color red.
      canvas drawString: p first asString          at: p first          font: nil          color: Color green.    ].
Or just reset the engine state (but I don't like this solution, the engine state should be private to the canvas).
   points do: [ :p |
      canvas drawPolygon: p          color: Color transparent          borderWidth: 1          borderColor: Color red.
      canvas drawString: p first asString          at: p first          font: nil          color: Color green.       canvas resetEngine.    ].
2018-04-06 2:57 GMT+02:00 <joe@boremaj.net>:
Hello everyone!
Im trying use the balloon canvas to draw some nice smooth anti aliased lines, but now i seem to have hit upon a bug which i dont know how to fix.
if i draw just lines i get everything i want.  but if i add a âdrawString:â¦â in there at any point, all the lines i try to draw subsequently dont show up.
Here is code that shows the exact issue:
form := Form extent: 100@100 depth: 32. form fillWhite. canvas := BalloonCanvas on: form. canvas aaLevel: 4. "canvas := FormCanvas on: form." points := { {10@10 . 50@43} . {50@42 . 90@75} . {90@75 . 50@90 } }.
points do: [ :p |   canvas drawPolygon: p    color: Color transparent    borderWidth: 1    borderColor: Color red.
  canvas drawString: p first asString    at: p first    font: nil    color: Color green. ].
morph := ImageMorph new. morph image: form. morph openCenteredInWorld.
if i comment out the canvas drawstring i get what you would expect: a squiggly line.
if i add in the drawstring, the first line shows up but all the subsequent lines do not get drawn. Â (both images attached)
I spent a bunch of time tracking it down to its most purest form and then a bunch of time debugging it and im out of my depth with the baloon code, i cant seem to figure out whats wrong. Â if anyone knows whats wrong or can give me a clue on how to fix it iâd greatly appreciate it.
thanks in advance.
{ jb }
Check the examples around Athens. On Fri, Apr 6, 2018 at 4:48 PM, <joe@boremaj.net> wrote:
That worked, thank you so much! This helps me get running in the interim while i investigate how to use Athens.
{ jb }
On Apr 6, 2018, 9:31 AM -0400, Nicolai Hess <nicolaihess@gmail.com>, wrote:
Hi Joe,
the problem is that the BalloonCanvas (or some objects it is using) aren't fully reset after some drawing operations. (the drawString method for example sets the sourceForm as glyph to be drawn).
it should work if you do not store the canvas instance, but create a new in every loop:
points do: [ :p |
canvas := form getCanvas asBalloonCanvas aaLevel:4; yourself.
canvas drawPolygon: p color: Color transparent borderWidth: 1 borderColor: Color red.
canvas drawString: p first asString at: p first font: nil color: Color green. ].
Or just reset the engine state (but I don't like this solution, the engine state should be private to the canvas).
points do: [ :p |
canvas drawPolygon: p color: Color transparent borderWidth: 1 borderColor: Color red.
canvas drawString: p first asString at: p first font: nil color: Color green. canvas resetEngine. ].
2018-04-06 2:57 GMT+02:00 <joe@boremaj.net>:
Hello everyone!
Im trying use the balloon canvas to draw some nice smooth anti aliased lines, but now i seem to have hit upon a bug which i dont know how to fix.
if i draw just lines i get everything i want. but if i add a âdrawString:â¦â in there at any point, all the lines i try to draw subsequently dont show up.
Here is code that shows the exact issue:
form := Form extent: 100@100 depth: 32. form fillWhite. canvas := BalloonCanvas on: form. canvas aaLevel: 4. "canvas := FormCanvas on: form." points := { {10@10 . 50@43} . {50@42 . 90@75} . {90@75 . 50@90 } }.
points do: [ :p | canvas drawPolygon: p color: Color transparent borderWidth: 1 borderColor: Color red.
canvas drawString: p first asString at: p first font: nil color: Color green. ].
morph := ImageMorph new. morph image: form. morph openCenteredInWorld.
if i comment out the canvas drawstring i get what you would expect: a squiggly line.
if i add in the drawstring, the first line shows up but all the subsequent lines do not get drawn. (both images attached)
I spent a bunch of time tracking it down to its most purest form and then a bunch of time debugging it and im out of my depth with the baloon code, i cant seem to figure out whats wrong. if anyone knows whats wrong or can give me a clue on how to fix it iâd greatly appreciate it.
thanks in advance.
{ jb }
participants (7)
-
Esteban Lorenzano -
Hilaire -
joe@boremaj.net -
Marcus Denker -
Nicolai Hess -
Norbert Hartl -
Stephane Ducasse