Draw2d
-
I'm trying to make a tool that draws 2d shapes (view.draw2d).
def Draw(view) view.draw2d(GL_LINE_STRIP, [Geom;;Point3d.new(1,1,1), Geom;;Point3d.new(500, 0, 0), Geom;;Point3d.new(500, 500, 0)]) puts "update" end
super simple, just to demo. It works, but it doesn't always work. When I orbit the view, there are times, often actually, where the lines are not drawn and the "update" message is not posted. Does anyone have any suggestions, tips, ideas? It didn't seem like there were to many tools out there using draw2d.
I've played around with getExtents, but what I put in there doesn't seem to make a difference. It probably only effects 3D drawing?
-
Found it. pushing the middle mouse button invokes the orbit tool. But it also suspends and resumes the currently active tool. By handling the resume method and calling view.invalidate, I can force it to redraw the screen every time the orbit tool finishes and returns to the drawing tool.
Advertisement