Skip to content

Commit

Permalink
With Constrain fix, can remove text alignment hack
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewcmyers committed Oct 29, 2024
1 parent 69c0f47 commit 80d92b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/constrain
6 changes: 3 additions & 3 deletions lectures/traversals/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ <h2>Tricolor algorithm</h2>
<script class=graphics>
with (new CFigure("tricolor")) {
let cr = canvasRect().inset(4)
let c1 = ellipse(), c2 = ellipse().addText("\nundiscovered").setVerticalAlign("top"),
c3 = ellipse().addText("\nunreachable").setVerticalAlign("top")
let c1 = ellipse(), c2 = ellipse().addText("undiscovered").setVerticalAlign("top"),
c3 = ellipse().addText("unreachable").setVerticalAlign("top")

equal(c1.w(), c2.w(), c3.w())

Expand All @@ -77,7 +77,7 @@ <h2>Tricolor algorithm</h2>
align("none", "top", c1, c2, c3, cr)

let c1g = ellipse().at(c1).setFillStyle("#ddd").addText("roots").setW(60).setH(40),
c2g = ellipse().at(c2).setFillStyle("#ddd").addText("\nfrontier").setInset(0).setVerticalAlign("top").setW(minus(c2.w(), 40)).setH(minus(c2.h(), 80))
c2g = ellipse().at(c2).setFillStyle("#ddd").addText("frontier").setInset(0).setVerticalAlign("top").setW(minus(c2.w(), 40)).setH(minus(c2.h(), 80))
c2b = ellipse().at(c2).setFillStyle("black").addText("finished").setTextStyle("white")
.setW(minus(c2g.w(), 70))
.setH(minus(c2g.h(), 60)),
Expand Down

0 comments on commit 80d92b7

Please sign in to comment.