David PHAM-VAN

Remove unused Polygon class

... ... @@ -58,7 +58,6 @@ part 'src/page.dart';
part 'src/page_format.dart';
part 'src/page_list.dart';
part 'src/point.dart';
part 'src/polygon.dart';
part 'src/rect.dart';
part 'src/signature.dart';
part 'src/stream.dart';
... ...
... ... @@ -180,15 +180,6 @@ class PdfGraphics {
lineTo(x2, y2);
}
/// Draws a polygon, linking the first and last coordinates.
///
/// @param xp Array of x coordinates
/// @param yp Array of y coordinates
/// @param np number of points in polygon
void drawPolygon(PdfPolygon p) {
_polygon(p.points);
}
void drawEllipse(double x, double y, double r1, double r2) {
moveTo(x, y - r2);
curveTo(x + _m4 * r1, y - r2, x + r1, y - _m4 * r2, x + r1, y);
... ... @@ -685,22 +676,6 @@ class PdfGraphics {
}
}
/// This is used to add a polygon to the current path.
/// Used by drawPolygon()
///
/// @param p Array of coordinates
/// @see #drawPolygon
/// @see #drawPolyline
/// @see #fillPolygon
void _polygon(List<PdfPoint> p) {
// newPath() not needed here as moveto does it ;-)
moveTo(p[0].x, p[0].y);
for (int i = 1; i < p.length; i++) {
lineTo(p[i].x, p[i].y);
}
}
void setLineCap(PdfLineCap cap) {
buf.putString('${cap.index} J\n');
}
... ...
/*
* Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
part of pdf;
class PdfPolygon {
PdfPolygon(this.points);
List<PdfPoint> points;
PdfRect getBounds() {
// TODO(me): Implement properly
return const PdfRect(0, 0, 0, 0);
}
}