File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -170,8 +170,16 @@ public struct GraphLayout {
170170 /// Makes adjustments to the layout as requested by the plot.
171171 private func adjustPlotSize( info: AdjustsPlotSize , results: inout Results ) {
172172 if info. desiredPlotSize != . zero {
173+ let topDifference = results. plotBorderRect. height - info. desiredPlotSize. height
173174 results. plotBorderRect. size = info. desiredPlotSize
175+ // Adjust the title location for the change in height.
176+ if var oldTitleLocation = results. titleLocation {
177+ oldTitleLocation. y -= topDifference/ 2
178+ results. titleLocation = oldTitleLocation
179+ }
180+ // FIXME: Adjust Y2 label and anything else on the right side.
174181 }
182+
175183 }
176184
177185 /// Rounds the given markers to integer pixel locations, for sharper gridlines.
You can’t perform that action at this time.
0 commit comments