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 {
170
170
/// Makes adjustments to the layout as requested by the plot.
171
171
private func adjustPlotSize( info: AdjustsPlotSize , results: inout Results ) {
172
172
if info. desiredPlotSize != . zero {
173
+ let topDifference = results. plotBorderRect. height - info. desiredPlotSize. height
173
174
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.
174
181
}
182
+
175
183
}
176
184
177
185
/// Rounds the given markers to integer pixel locations, for sharper gridlines.
You can’t perform that action at this time.
0 commit comments