arrolio 0.1.2 → 0.1.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 +4 -4
- data/lib/arrolio/engine/margin_collapse.rb +28 -0
- data/lib/arrolio/engine/paged.rb +1 -2
- data/lib/arrolio/engine.rb +1 -0
- data/lib/arrolio/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 01c161c7d50fa2733c29d4c89dd8aa5c7f1bec160b74a9c9635755c10a901709
|
|
4
|
+
data.tar.gz: aff7bfe967cad51a94b9360bdb7e2d6f9f57f47706d625cac8bed4426dfc5d01
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c3ca8fbbd589e1a5cc712a378e5e5aa3301a8a8ea92d0043c9f3abdfa3a81fd5b7a087076ef419e5b8e589adf85aa88aaf0698190856c3d4171fd41fee41b11f
|
|
7
|
+
data.tar.gz: d31df0b59b87063bcdc79b2490598387f9050ffd367dd9496b1093e47d17e34ab37eaf475cf350e656157be9800d55bc059bec9c7eaf305a9e2f06a746802f44
|
|
@@ -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
|
data/lib/arrolio/engine/paged.rb
CHANGED
|
@@ -136,8 +136,7 @@ module Arrolio
|
|
|
136
136
|
x = frame.x
|
|
137
137
|
y_top = frame.cursor_y
|
|
138
138
|
|
|
139
|
-
|
|
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)
|
data/lib/arrolio/engine.rb
CHANGED
data/lib/arrolio/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.1.3
|
|
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-
|
|
11
|
+
date: 2026-08-30 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
|