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" endsuper 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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đź’—
Register LoginAdvertisement