Skip to content

Commit

Permalink
Remove the unnecessary height setter (ForNeVeR#100)
Browse files Browse the repository at this point in the history
These items are horizontal paddings, so their height shouldn't matter at
all.
  • Loading branch information
ForNeVeR committed Aug 11, 2019
1 parent 5536af2 commit ec60071
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellLeftPad0:0",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand Down Expand Up @@ -126,11 +126,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellRightPad0:0",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand All @@ -140,11 +140,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellLeftPad0:1",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.39374999999999993,
"Italic": 0.0,
"Width": 0.39374999999999993,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand Down Expand Up @@ -228,11 +228,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellRightPad0:1",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.39374999999999993,
"Italic": 0.0,
"Width": 0.39374999999999993,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand All @@ -242,11 +242,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellLeftPad0:2",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand Down Expand Up @@ -330,11 +330,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellRightPad0:2",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
}
Expand Down Expand Up @@ -387,11 +387,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellLeftPad1:0",
"TotalHeight": 3.0388880000000005,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 3.0388880000000005,
"Height": 0.0,
"Depth": 0.0,
"Shift": 1.8416660000000002
},
Expand Down Expand Up @@ -475,11 +475,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellRightPad1:0",
"TotalHeight": 3.0388880000000005,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 3.0388880000000005,
"Height": 0.0,
"Depth": 0.0,
"Shift": 1.8416660000000002
},
Expand All @@ -489,11 +489,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellLeftPad1:1",
"TotalHeight": 3.0388880000000005,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 3.0388880000000005,
"Height": 0.0,
"Depth": 0.0,
"Shift": 2.863888
},
Expand Down Expand Up @@ -553,11 +553,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellLeftPad0:0",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand Down Expand Up @@ -641,11 +641,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellRightPad0:0",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
}
Expand Down Expand Up @@ -698,11 +698,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellLeftPad1:0",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand Down Expand Up @@ -786,11 +786,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellRightPad1:0",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
}
Expand Down Expand Up @@ -899,11 +899,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellRightPad1:1",
"TotalHeight": 3.0388880000000005,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 3.0388880000000005,
"Height": 0.0,
"Depth": 0.0,
"Shift": 2.863888
},
Expand All @@ -913,11 +913,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellLeftPad1:2",
"TotalHeight": 3.0388880000000005,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 3.0388880000000005,
"Height": 0.0,
"Depth": 0.0,
"Shift": 1.8416660000000002
},
Expand Down Expand Up @@ -1001,11 +1001,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellRightPad1:2",
"TotalHeight": 3.0388880000000005,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 3.0388880000000005,
"Height": 0.0,
"Depth": 0.0,
"Shift": 1.8416660000000002
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellLeftPad0:0",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand Down Expand Up @@ -154,11 +154,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellRightPad0:0",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand All @@ -168,11 +168,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellLeftPad0:1",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand Down Expand Up @@ -256,11 +256,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellRightPad0:1",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
}
Expand Down Expand Up @@ -313,11 +313,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellLeftPad1:0",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand Down Expand Up @@ -401,11 +401,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellRightPad1:0",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand All @@ -415,11 +415,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellLeftPad1:1",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
},
Expand Down Expand Up @@ -503,11 +503,11 @@
"Foreground": null,
"Background": null,
"Tag": "CellRightPad1:1",
"TotalHeight": 0.994444,
"TotalHeight": 0.0,
"TotalWidth": 0.175,
"Italic": 0.0,
"Width": 0.175,
"Height": 0.994444,
"Height": 0.0,
"Depth": 0.0,
"Shift": 0.81944400000000006
}
Expand Down
7 changes: 2 additions & 5 deletions src/WpfMath/Atoms/MatrixAtom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,9 @@ private static List<List<CellGaps>> CalculateCellGaps(
for (int j = 0; j < row.Children.Count; j++)
{
var rowcolitem = row.Children[j];
if (rowcolitem is StrutBox)
{
rowcolitem.Height = rowHeights[rowIndex];
}
else if (rowcolitem is VerticalBox && rowcolitem.Tag.ToString() == $"Cell{rowIndex}:{columns}")
if (rowcolitem is VerticalBox && rowcolitem.Tag.ToString() == $"Cell{rowIndex}:{columns}")
{
// TODO[F]: require the vertical box list as input
double cellVShift = rowHeights[rowIndex] - rowcolitem.TotalHeight;

double cellHShift = columnWidths[columns] - rowcolitem.TotalWidth;
Expand Down

0 comments on commit ec60071

Please sign in to comment.