Created
February 22, 2012 02:06
-
-
Save DSDev-NickHogle/1880643 to your computer and use it in GitHub Desktop.
Helps fix the one-frame delay problem when running Google Sketchup in Wine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fixes the view each time the view changes | |
require 'sketchup' | |
module NH | |
module ViewFix | |
class MyViewObserver < Sketchup::ViewObserver | |
def onViewChanged( view ) | |
puts "View changed: #{view.inspect}" | |
puts "Invalidating view..." | |
view.refresh | |
end | |
end | |
def self.fix_view | |
# Remove old observer | |
Sketchup.active_model.active_view.remove_observer( @observer ) if @observer | |
# Attach the observer. | |
@observer = Sketchup.active_model.active_view.add_observer( MyViewObserver.new ) | |
puts @observer | |
end | |
end | |
end | |
UI.menu("Plugins").add_item("Fix View") do | |
NH::ViewFix.fix_view | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment