[Ruby] view.draw_text & X-Ray/Hidden Line Face Style
-
I ran into this issue today, reported it to google but thought I'd post it here for reference as there's an easy workaround.
If you're using the
view.draw_text
method in your ruby plugin or tool there's an issue when you switch the face style to X-Ray or Hidden Line.view.draw_text
will only work under X-Ray or Hidden Line if you invoke some otherview.draw*
method. Here's my testable exampledef draw(view) ##comment out the following line to produce the view.draw_text bug status = view.draw2d GL_LINES, [Geom;;Point3d.new(13,10,0),Geom;;Point3d.new(13,10,0)] pt = Geom;;Point3d.new 13,10,0 status = view.draw_text pt, "view.draw_text working!" end #def
When you've attached this to a tool you can reproduce the error by running the tool with the line
status = view.draw2d...
commented out.status = view.draw2d GL_LINES, [Geom::Point3d.new(13,10,0),Geom::Point3d.new(13,10,0)]
tries to draw a line between two points that are in the same position (and hopefully fails to draw anything on the screen).Tested on:
Windows 7 Ultimate
Sketchup Pro 8.0.4811
ATI Radeon HD 5770 (Driver Version: 8.881-110728a-124445C-ATI)
Advertisement