You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To <dfn>determine the gap decoration segments</dfn> for a given [=gap=] |G|:
345
365
<ol>
346
366
<li>
347
367
Let |S|, the collection of [=gap decoration segments=] for |G|, be an empty list.
348
368
</li>
349
369
<li>
350
-
Let |endpoints| be the list of all <a>segment endpoints</a><a lt="create segment endpoints for a gap">created</a> for |G|,
351
-
ordered by their position along the centerline from start to end.
370
+
Let |endpoints| be the result of [=creating segment endpoints=] for |G|,
371
+
ordered by their position along |G|'s centerline from start to end.
372
+
373
+
Note: This list is guaranteed to contain an even number of elements that strictly alternate
374
+
between [=start segment endpoint=] and [=end segment endpoint=], beginning with a [=start segment endpoint=].
352
375
</li>
353
376
<li>
354
377
While |endpoints| is not empty:
@@ -364,9 +387,55 @@ Segments</h4>
364
387
</li>
365
388
</ol>
366
389
367
-
Note: Based on the algorithm for [=create segment endpoints for a gap|creating segment endpoints=],
368
-
the list |endpoints| is guaranteed to contain an even number of elements that strictly alternate
369
-
between [=start segment endpoint=] and [=end segment endpoint=], beginning with a [=start segment endpoint=].
390
+
</div>
391
+
392
+
<div algorithm>
393
+
To <dfn>determine painted segments</dfn> |C| from segments list |S|:
394
+
395
+
<ol>
396
+
<li>Let |S| be the list of segments <a lt="determine the gap decoration segments">determined</a> for the given gap, ordered from start to end along the gap's axis.
397
+
<li>Let |C| be an empty list of segments.
398
+
<li>Let |break| be the used value of either 'column-rule-break' or 'row-rule-break', whichever applies to the gap.
399
+
400
+
<li>If |S| is empty, return |C|.
401
+
402
+
<li>If |break| is ''column-rule-break/none'':
403
+
<ol>
404
+
<li>Let |first| be the first segment in |S|.
405
+
<li>Let |last| be the last segment in |S|.
406
+
<li>Let |segment| be [=UNION=](|first|, |last|).
407
+
<li>[=Apply offsets to a segment|Apply offsets to=] |segment|, then append it to |C|.
408
+
<li>Return |C|.
409
+
</ol>
410
+
411
+
<li>Remove the first segment from |S|. Let |s| be that segment.
412
+
413
+
<li>If |s|'s endpoints are <a>discontiguous</a>, go back to step 4.
414
+
415
+
<li>If |S| is not empty:
416
+
<ol>
417
+
<li>Let |next| be the first segment in |S|.
418
+
<li>Let |candidate| be <a>UNION</a>(|s|, |next|).
419
+
<li>If |candidate|'s endpoints are <a>discontiguous</a>, go to step 9.
420
+
<li>If |break| is ''column-rule-break/intersection'' and |candidate| is not <a>flanked by spanning items</a>, go to step 9.
421
+
<li>Remove the first segment from |S|.
422
+
<li>Set |s| to <a>UNION</a>(|s|, |next|).
423
+
<li>Go back to step 8.
424
+
</ol>
425
+
426
+
<li>[=Apply offsets to a segment|Apply offsets to=] |s|, then append it to |C|.
427
+
428
+
<li>Go back to step 4.
429
+
</ol>
430
+
</div>
431
+
432
+
<div algorithm>
433
+
To <dfn>apply offsets to a segment</dfn> |s| = [|start|, |end|]:
434
+
<ol>
435
+
<li>Offset |start| by the used value of the applicable [[#inset|rule-inset]] property.
436
+
<li>Offset |end| by the used value of the applicable [[#inset|rule-inset]] property.
437
+
<li>Update |s| with the adjusted [|start|, |end|].
438
+
</ol>
370
439
</div>
371
440
372
441
<div class="example">
@@ -424,71 +493,6 @@ Segments</h4>
424
493
</figure>
425
494
</div>
426
495
427
-
<h4 id="painted-segments">
428
-
Painted segments</h4>
429
-
430
-
Recall that a <a>gap decoration segment</a>, |s|, can be represented as:
431
-
|s| = [|s|.start, |s|.end]
432
-
where |s|.start is the <a>start segment endpoint</a> of the segment, and |s|.end is the <a>end segment endpoint</a> of the segment.
433
-
434
-
In the context of a given gap, a pair of <a>segment endpoints</a> |a| and |b| is considered <dfn>discontiguous</dfn>
435
-
if a line segment from |a| to |b|, with the same width as the gap, intersects a child item in the container.
436
-
437
-
Let <dfn>UNION</dfn>(|s1|, |s2|) be equal to [|s1|.start, |s2|.end].
438
-
439
-
A [=gap decoration segment=] is <dfn>flanked by spanning items</dfn> if, for
440
-
every [=gap junction=] between its endpoints, there exist items on opposing sides of
441
-
the gap that span across all perpendicular [=gaps=] contributing to that junction.
442
-
443
-
<div algorithm>
444
-
To <dfn>determine painted segments</dfn> |C| from segments list |S|:
445
-
446
-
<ol>
447
-
<li>Let |S| be the list of segments <a lt="determine the gap decoration segments">determined</a> for the given gap, ordered from start to end along the gap's axis.
448
-
<li>Let |C| be an empty list of segments.
449
-
<li>Let |break| be the used value of either 'column-rule-break' or 'row-rule-break', whichever applies to the gap.
450
-
451
-
<li>If |S| is empty, return |C|.
452
-
453
-
<li>If |break| is ''column-rule-break/none'':
454
-
<ol>
455
-
<li>Let |first| be the first segment in |S|.
456
-
<li>Let |last| be the last segment in |S|.
457
-
<li>Let |segment| be [=UNION=](|first|, |last|).
458
-
<li>[=Apply offsets to a segment|Apply offsets to=] |segment|, then append it to |C|.
459
-
<li>Return |C|.
460
-
</ol>
461
-
462
-
<li>Remove the first segment from |S|. Let |s| be that segment.
463
-
464
-
<li>If |s|'s endpoints are <a>discontiguous</a>, go back to step 4.
465
-
466
-
<li>If |S| is not empty:
467
-
<ol>
468
-
<li>Let |next| be the first segment in |S|.
469
-
<li>Let |candidate| be <a>UNION</a>(|s|, |next|).
470
-
<li>If |candidate|'s endpoints are <a>discontiguous</a>, go to step 9.
471
-
<li>If |break| is ''column-rule-break/intersection'' and |candidate| is not <a>flanked by spanning items</a>, go to step 9.
472
-
<li>Remove the first segment from |S|.
473
-
<li>Set |s| to <a>UNION</a>(|s|, |next|).
474
-
<li>Go back to step 8.
475
-
</ol>
476
-
477
-
<li>[=Apply offsets to a segment|Apply offsets to=] |s|, then append it to |C|.
478
-
479
-
<li>Go back to step 4.
480
-
</ol>
481
-
</div>
482
-
483
-
<div algorithm>
484
-
To <dfn>apply offsets to a segment</dfn> |s| = [|start|, |end|]:
485
-
<ol>
486
-
<li>Offset |start| by the used value of the applicable [[#inset|rule-inset]] property.
487
-
<li>Offset |end| by the used value of the applicable [[#inset|rule-inset]] property.
488
-
<li>Update |s| with the adjusted [|start|, |end|].
0 commit comments