rpdfium 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28e6412dd11dd39727aebd3d62c084d3fdbd7a7a3b15ebd7ceb61b978de08770
4
- data.tar.gz: 6a7dbd79f442d703020f286003a183e946f3b35eb8d206e339804e493d1d7c04
3
+ metadata.gz: acc10e2700ca1e013088725b09fd05d4dee4f9fcf7acdcddba499306f24ec9f7
4
+ data.tar.gz: 9f1f2bb6b40e61e457589d7756eff6fdb85f99310cea86c0a41a187da6f4e32a
5
5
  SHA512:
6
- metadata.gz: 6781340e17cdc757fde6334e6266bb1cf5db109b5935ea76eadc7fa6af1b750c91b2bdb0e579af09eb6504bac87fc1d8fd906b2e02dea0229147294380f44c97
7
- data.tar.gz: e6aee42be9d8f6b80ce248cf90b7b44e1fa39feae71d0d8d56d32f32c19298e55d1fc5f6acf67189c9d55fc6b9825a293cecd170aa7e410236ff80ab88c1ff92
6
+ metadata.gz: 07a60e4c5304e1650f583a691e324daf0f2b5fcbb7f1efdd8d333ac8a1fc7e48b7230e23d9cda9c0d8b73e8382c5faa7bf0737e3230bebf55cefe13d822e474d
7
+ data.tar.gz: 2dc6accfa959ced0852d1b48c729eab47556a26eb0ee3e94bc6d3644d7f5d78530ccfd70244a6aa88ea7e2cac4c6a46973db8d8f2838c8b4cad5eccade42a53d
data/CHANGELOG.md CHANGED
@@ -8,6 +8,20 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.4.3] - 2026-06-16
12
+
13
+ ### Fixed
14
+
15
+ - **`Page#words` now returns numeric `top`/`bottom` coordinates.** Each word's
16
+ `:top` and `:bottom` fields were computed with `chars.min { |c| c[:top] }` /
17
+ `chars.max { |c| c[:bottom] }`. The block form of `Enumerable#min`/`max` must
18
+ return a comparator (-1/0/1) and receives two arguments, so the numeric value
19
+ returned by the single-argument block was used as a broken comparator and the
20
+ method returned the whole char hash instead of the position. As a result
21
+ `word[:top]` and `word[:bottom]` were no longer positional numbers. Fixed by
22
+ using `chars.map { |c| c[:top] }.min` / `.max`, which return the expected
23
+ scalar.
24
+
11
25
  ## [0.4.2] - 2026-06-15
12
26
 
13
27
  ### Added
data/lib/rpdfium/page.rb CHANGED
@@ -1599,8 +1599,8 @@ module Rpdfium
1599
1599
  text: chars.map { |c| c[:char] }.join,
1600
1600
  x0: chars.first[:x0],
1601
1601
  x1: chars.last[:x1],
1602
- top: chars.min { |c| c[:top] },
1603
- bottom: chars.max { |c| c[:bottom] },
1602
+ top: chars.map { |c| c[:top] }.min,
1603
+ bottom: chars.map { |c| c[:bottom] }.max,
1604
1604
  fontsize: chars.first[:fontsize],
1605
1605
  font: chars.first[:font],
1606
1606
  chars: chars
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rpdfium
4
- VERSION = "0.4.2"
4
+ VERSION = "0.4.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpdfium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Scinocca