Python Tip: User Scrolling

Just another quick tip.  Sometimes I create python to use as a demonstration. Here is an example:

https://trinket.io/glowscript/717bedba81

This is a double pendulum (sorry for the lack of embeds – I hope to fix that soon).  But there is a problem when you use the code as an embedded demo.  What happens if a user is reading over a blog post using the scroll wheel?  If they mouse over the trinket embed and scroll, they will zoom out and not see anything.

You can fix this by adding the following:

Yes, just add scene.userzoom=False

That’s it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s