thomthom / solid-inspector

Inspect and repair solid groups and components in SketchUp.
https://extensions.sketchup.com/en/content/solid-inspector%C2%B2
MIT License
18 stars 2 forks source link

ESC misbehaviour #56

Open thomthom opened 3 years ago

thomthom commented 3 years ago

https://forums.sketchup.com/t/solid-inspector/5117/218?u=thomthom

https://forums.sketchup.com/t/solid-inspector/5117/222?u=thomthom

https://forums.sketchup.com/t/solid-inspector/5117/224?u=thomthom

orbitaleccentric commented 2 years ago

Thomas,

Paul McAlenan here - https://forums.sketchup.com/t/solid-inspector/5117/218

I noticed that using the ESC key to exit Inspector works only if there are "errors".

In inspector_tool.rb there is the following method:

def onKeyUp(key, repeat, flags, view)
      return if @errors.empty?

and then at the end before view.invalidate there is:

if key == KEY_ESCAPE
    deselect_tool
    #return true
end 

So if @errors is empty the method returns which means that the Esc key is never detected - I don't know if this is intended behaviour.

If I move if key == KEY_ESCAPE... ...end to before return if @errors.empty? I can exit Inspector when there are no "errors".

Not sure if this would have any unintended consequences.