calculateOffsets method

  1. @override
void calculateOffsets()
override

Also sets circleBox: the largest centered square of the content area, shrunk by the selection shift of the data set on every side.

Implementation

@override
void calculateOffsets() {
  super.calculateOffsets();

  final data = this.data;
  if (data == null) return;

  final radius = diameter / 2;

  final c = centerOffsets;

  final shift = Utils.convertDpToPixel(data.dataSet?.selectionShift ?? 0);

  circleBox.set(
    c.x - radius + shift,
    c.y - radius + shift,
    c.x + radius - shift,
    c.y + radius - shift,
  );

  MPPointF.recycleInstance(c);
}