arrolio 0.1.2 → 0.1.4

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: e9d301e46536064070bccbf04046e06cdb94b4eab0aba48480c1d8206ab067e9
4
- data.tar.gz: f6f3d63a924dbba3cb2af4d0b818e9b26516a1e7feb315e9c9730cc79d680e7f
3
+ metadata.gz: f0b6af09c229c5ee869a2e052c61933ccf441cccf02ace5b965acaf2dcdfa277
4
+ data.tar.gz: 650539bee9ae880208f9986e26ccc4a9ffe38acbf773a47a1471a54cfb43f688
5
5
  SHA512:
6
- metadata.gz: d4e6680ffacf7bbbd4712464d491d2a25113af8042ab21dae643b96b1c7c24d50b57f0133a782f29516baf5040fd3ee7af5e6a4206695b5f74e301145708c6d8
7
- data.tar.gz: 481a67ecf12a9875149753453985ce2ab458717b7a05097581fc30723ef831ac3b17e113915611c50ba4a95672c29c47829eee39ec9bf5b798a408b1c3ef8cd5
6
+ metadata.gz: c8ea9131445f66cdcae37550aebb04036bcbedc995e713220f3e2c76391b2c35e6daa6f71b6e2d32a51f6ad33b526c36e6d2fdc5fac5dd92d0440b31bb7c2a7c
7
+ data.tar.gz: 19a06bdb5726413dcea2de7022eab8ede88c9a10133ad78545211eb294e1ec5884bd47c7753fdaed9ddc6ef5afac1e71b177fdc30b6061f5af39a03ff894b30e
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Arrolio
4
+ module Engine
5
+ # The engine's block-margin collapse rule — the ONE place the
6
+ # spacing between consecutive flowables is decided.
7
+ #
8
+ # Current semantics (verified against the reference render):
9
+ # the incoming flowable's consumption is reduced by
10
+ # min(prev_space_after, curr_space_before). Because
11
+ # TextFlowable counts its margins inside consumed while
12
+ # ListFlowable-based flowables do not (see Flowable's margin
13
+ # contract), the EFFECTIVE gap works out to CSS max() only
14
+ # when curr.space_before <= prev.space_after; otherwise the
15
+ # gap under-shoots. The calibrated flavor spacing rides these
16
+ # quirks — unify only together with recalibration (TODO 96).
17
+ module MarginCollapse
18
+ module_function
19
+
20
+ # The overlap subtracted from the incoming flowable's
21
+ # consumption: the previous flowable already charged its
22
+ # space-after into the cursor.
23
+ def overlap(prev_space_after, curr_space_before)
24
+ [prev_space_after.to_f, curr_space_before.to_f].min
25
+ end
26
+ end
27
+ end
28
+ end
@@ -136,8 +136,7 @@ module Arrolio
136
136
  x = frame.x
137
137
  y_top = frame.cursor_y
138
138
 
139
- curr_before = flowable.space_before.to_f
140
- overlap = [@prev_space_after, curr_before].min
139
+ overlap = MarginCollapse.overlap(@prev_space_after, flowable.space_before)
141
140
  adjusted_y = y_top + overlap
142
141
 
143
142
  boxes, consumed = flowable.emit(x, adjusted_y, frame.width, context)
@@ -4,6 +4,7 @@
4
4
  module Arrolio
5
5
  module Engine
6
6
  autoload :Paged, 'arrolio/engine/paged'
7
+ autoload :MarginCollapse, 'arrolio/engine/margin_collapse'
7
8
  autoload :CrossReferenceRegistry, 'arrolio/engine/cross_reference_registry'
8
9
  end
9
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Arrolio
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arrolio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-08-29 00:00:00.000000000 Z
11
+ date: 2026-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fontisan
@@ -340,6 +340,7 @@ files:
340
340
  - lib/arrolio/embedded_block_extractor.rb
341
341
  - lib/arrolio/engine.rb
342
342
  - lib/arrolio/engine/cross_reference_registry.rb
343
+ - lib/arrolio/engine/margin_collapse.rb
343
344
  - lib/arrolio/engine/paged.rb
344
345
  - lib/arrolio/error.rb
345
346
  - lib/arrolio/flavor.rb