From 4f0524c199902b5e363b63c8df40e03ecc2e069b Mon Sep 17 00:00:00 2001 From: bptato Date: Fri, 20 Dec 2024 22:37:15 +0100 Subject: box: InlineFragment -> InlineBox It was named "fragment" mainly because I added it back when there was still a separate InlineBox type and I needed another name. Now InlineBox is gone, and I'm tired of typing fragment. --- src/server/buffer.nim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/server') diff --git a/src/server/buffer.nim b/src/server/buffer.nim index bb2ab92c..474c1bd3 100644 --- a/src/server/buffer.nim +++ b/src/server/buffer.nim @@ -687,18 +687,18 @@ type GotoAnchorResult* = object proc findAnchor(box: BlockBox; anchor: Element): Offset -proc findAnchor(fragment: InlineFragment; anchor: Element): Offset = - if fragment.t == iftBox: - let off = fragment.box.findAnchor(anchor) +proc findAnchor(box: InlineBox; anchor: Element): Offset = + if box.t == ibtBox: + let off = box.box.findAnchor(anchor) if off.y >= 0: return off - elif fragment.t == iftParent: - for child in fragment.children: + elif box.t == ibtParent: + for child in box.children: let off = child.findAnchor(anchor) if off.y >= 0: return off - if fragment.node != nil and fragment.node.node == anchor: - return fragment.render.offset + if box.node != nil and box.node.node == anchor: + return box.render.offset return offset(-1, -1) proc findAnchor(box: BlockBox; anchor: Element): Offset = -- cgit