Strange Bug in CF 2.2 (v18) (graphics library?)

Here you can discuss and share functionality improvements and helper programs to make Context Free better.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
Posts: 2
Joined: Thu Jun 18, 2009 7:02 pm

Strange Bug in CF 2.2 (v18) (graphics library?)

Post by aihle »

There seems to be some rounding error problem in either ContextFree or the used graphics library. Consider this code which should give a solid black square:

Code: Select all

startshape INIT

size {x -20}

rule INIT {
	SQUARE   {s 40 x 20}
Instead of a black square I get this:

I tried several values for detail in the Render To Size dialog which creates different patterns. For above image, the value is 0,00499999988824129 (I entered 0,005 but it changed to this obscure value for some odd reason at confirmation)

This problem also only appears when using no scaling in the "size" directive. Using scale values > 1 creates a black square, using values < 1 produces a blank screen (one exception found: s 0.8 )

Not a big problem since I only stumbled upon this problem while debugging my code but I figured you still might want to know.

User avatar
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California

Post by MtnViewJohn »

I can't reproduce this on the Mac version. I'll try it on the Windows version when I get back from vacation.

Post Reply