Jump to content

Graph grid and axes not drawn when not cleared previously


crteensy

Recommended Posts

I just compiled the graph demo for playing with it and noticed that the plots are drawn correctly, but the grids and axes are invisible. This can be fixed by calling gwinClear(gh) before doing any further init, but that's not documented and it's also missing in the demo code. So the correct init code should be

	gwinClear(gh); // <------ add this, line 80
gwinGraphSetOrigin(gh, gwinGetWidth(gh)/2, gwinGetHeight(gh)/2);
gwinGraphSetStyle(gh, &GraphStyle1);
gwinGraphDrawAxis(gh);

instead of

	gwinGraphSetOrigin(gh, gwinGetWidth(gh)/2, gwinGetHeight(gh)/2);
gwinGraphSetStyle(gh, &GraphStyle1);
gwinGraphDrawAxis(gh);

Edit: The documentation says "The graph is not automatically cleared. You must do that first by calling gwinClear()." but to me that doesn't indicate that the axes and grid won't be drawn when the graph is not cleared.

Link to comment
Share on other sites

Not sure why the axis and grid are not being displayed without the clear first - they used to. This is a very old demo however and has not been checked in a long time so I will debug to see what is happening when I get a moment.

Theoretically as the screen is already clear it shouldn't be necessary to clear it again. I suspect some of the widget flags are no longer being initialised correctly.

Glad you found a work around in the mean time.

Link to comment
Share on other sites

  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...