polygonPoints property

List<int> get polygonPoints

Gets the polygon points of the annotation.

Implementation

List<int> get polygonPoints {
  if (_helper.isLoadedAnnotation) {
    final List<int> points = <int>[];
    final PdfDictionary dictionary =
        PdfAnnotationHelper.getHelper(this).dictionary!;
    if (dictionary.containsKey(PdfDictionaryProperties.vertices)) {
      final PdfArray? linePoints =
          dictionary[PdfDictionaryProperties.vertices] as PdfArray?;
      if (linePoints != null) {
        // ignore: avoid_function_literals_in_foreach_calls
        linePoints.elements.forEach((IPdfPrimitive? element) {
          if (element != null && element is PdfNumber) {
            points.add(element.value!.toInt());
          }
        });
      }
    }
    return points;
  } else {
    return _helper._polygonPoints;
  }
}