samnissen / watir-screenshot-stitch

Extends Watir to take full page screenshots of websites.
MIT License
17 stars 7 forks source link

Resolution doubling determination does not allow for changing resolution to non-retina #30

Closed samnissen closed 6 years ago

samnissen commented 6 years ago

The setting of @mac_factor is never overridden in non-retina situations, meaning that once a save_stitch screenshot is captured on a 2x resolution ('retina') display, all subsequent screenshots taken by that browser will use that @mac_factor.

def calculate_dimensions
  # ...
  @mac_factor         = 2 if retina?
  @mac_factor       ||= 1
  # ...
end

Something like this is probably preferable:

@mac_factor = retina? ? 2 : 1