private void Graph_SizeAllocated(object sender, SizeAllocatedArgs args) { width = args.Allocation.Width; height = args.Allocation.Width; RecalculateLayout(); drawingArea.QueueResize(); }
void updateSizing() { SampleQueue data = debugManager.PowerData; vertMax = 10; if (data != null) { drawer.SetSizeRequest(data.Count / scale, -1); // Calculate a scale for the vertical axis. while (vertMax < data.Max) { vertMax *= 10; } // Calculate a good time-division spacing int usPerPx = scale * data.Period; hSpacingUs = 1; while (hSpacingUs / usPerPx < 20) { hSpacingUs *= 10; } } drawer.QueueResize(); updateStatus(); }