Skip to content

Commit

Permalink
chore: add changelog entry
Browse files Browse the repository at this point in the history
  • Loading branch information
route committed Nov 9, 2023
1 parent 2f9e94f commit 98a7acb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- `#set_behavior` where and whether to store file

### Changed
- `Ferrum::Page#screeshot` accepts :area option [#410]

### Fixed

Expand Down
8 changes: 4 additions & 4 deletions lib/ferrum/page/screenshot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
module Ferrum
class Page
module Screenshot
PARTIAL_SCREENSHOT_ARGUMENTS_MESSAGE = "Ignoring :selector or :area in #screenshot since full: true was given at "
AREA_SCREENSHOT_ARGUMENT_MESSAGE = "Ignoring :area in #screenshot since selector: was given at "
FULL_WARNING = "Ignoring :selector or :area in #screenshot since full: true was given at %s"
AREA_WARNING = "Ignoring :area in #screenshot since selector: was given at %s"

DEFAULT_PDF_OPTIONS = {
landscape: false,
Expand Down Expand Up @@ -221,8 +221,8 @@ def format_options(format, path, quality)
end

def area_options(full, selector, scale, area = nil)
warn("#{PARTIAL_SCREENSHOT_ARGUMENTS_MESSAGE}#{caller(1..1).first}") if full && (selector || area)
warn("#{AREA_SCREENSHOT_ARGUMENT_MESSAGE}#{caller(1..1).first}") if selector && area
warn(FULL_WARNING % caller(1..1).first) if full && (selector || area)
warn(AREA_WARNING % caller(1..1).first) if selector && area

clip = if full
full_window_area || viewport_area
Expand Down

0 comments on commit 98a7acb

Please sign in to comment.