Skip to content

Instantly share code, notes, and snippets.

@daniel-nelson
Created January 7, 2014 21:41
Show Gist options
  • Save daniel-nelson/8307420 to your computer and use it in GitHub Desktop.
Save daniel-nelson/8307420 to your computer and use it in GitHub Desktop.
If the top or left edge of an Adobe Flash object in a web page is aligned on a fraction of a pixel, the camera and microphone permission buttons are unclickable. They are also (or at least used to be) unclickable when the browser window is zoomed in or out. This CoffeeScript method adjusts the offset to place the upper-left corner on an integer …
fixFlashMargin: =>
$recorder = @modalContainer().find('.asset_editor_modal_container object')
offset = $recorder.offset()
$recorder.offset
top: Math.round(offset.top)
left: Math.round(offset.left)
# https://github.com/tombigel/detect-zoom
# Apparently detect-zoom is no longer reliable
if DetectZoom.ratios().zoom != 1
key = if $('html').hasClass('mac') then 'Command' else 'Control'
alert("""<div class="alert alert-error">Your browser is zoomed. Press #{key}+0 to un-zoom.</div>""")
else if r.zoom == 1 and @warningDisplayed()
@modalContainer().find('.asset_editor_modal_container .alert-error').remove()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment