Skip to content

Commit

Permalink
[set-example] set labels to constant height to work around inconsiste…
Browse files Browse the repository at this point in the history
…nt font size issue (#340) (HACK: only works for examples where we know labels have the same height). also fix issue with centerArrow where the spacing was doubled on one end, not sure why
  • Loading branch information
katherineye committed May 13, 2020
1 parent 5a736c2 commit ea4fa10
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion examples/set-theory-domain/tree.sty
@@ -1,5 +1,10 @@
Set x {
x.shape = Text { string : x.label }
x.shape = Text {
-- h : 20.0
fontSize: "12pt"
-- HACK: To get consistent-looking labels since we they have the same height in this example
string : x.label
}
}

Set x; Set y {
Expand Down
3 changes: 2 additions & 1 deletion examples/set-theory-domain/venn-simple.sty
Expand Up @@ -17,7 +17,8 @@ forall Set x {

x.text = Text {
string : x.label
fontSize : "15pt"
h : 50.0
-- fontSize : "15pt"
}

-- These statements are named because may delete a shape
Expand Down
4 changes: 3 additions & 1 deletion examples/set-theory-domain/venn.sty
Expand Up @@ -40,7 +40,9 @@ forall Set x {

x.text = Text {
string : x.label
fontSize : "15pt"
h : 50.0
-- HACK: To get consistent-looking labels since we they have the same height in this example
-- fontSize : "15pt"
}

-- These statements are named because may delete a shape
Expand Down
2 changes: 1 addition & 1 deletion src/Penrose/Functions.hs
Expand Up @@ -1816,7 +1816,7 @@ centerArrow [GPI arr@("Arrow", _), GPI text1@("Text", _), GPI text2@("Text", _)]
arr
[getX text1, getY text1]
[getX text2, getY text2]
[spacing * getNum text1 "h", negate $ 2 * spacing * getNum text2 "h"]
[spacing * getNum text1 "h", negate $ spacing * getNum text2 "h"]
centerArrow [GPI arr@("Arrow", _), GPI text@("Text", _), GPI circ@("Circle", _)] =
_centerArrow
arr
Expand Down

0 comments on commit ea4fa10

Please sign in to comment.