From d3973ce274b6249eb95f0f7a85a6f15905a7c207 Mon Sep 17 00:00:00 2001 From: meetwq Date: Fri, 30 Aug 2024 16:07:13 +0800 Subject: [PATCH] add missing pybind11 include --- src/skia/Picture.cpp | 1 + src/skia/Point.cpp | 1 + tests/test_point.py | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/src/skia/Picture.cpp b/src/skia/Picture.cpp index cdfe43a70..953587cf8 100644 --- a/src/skia/Picture.cpp +++ b/src/skia/Picture.cpp @@ -3,6 +3,7 @@ #include #include #include +#include namespace { diff --git a/src/skia/Point.cpp b/src/skia/Point.cpp index 9048f54fa..11b313203 100644 --- a/src/skia/Point.cpp +++ b/src/skia/Point.cpp @@ -1,6 +1,7 @@ #include "common.h" #include #include +#include void initPoint(py::module &m) { // IPoint diff --git a/tests/test_point.py b/tests/test_point.py index e1f010eb0..6efcab49b 100644 --- a/tests/test_point.py +++ b/tests/test_point.py @@ -105,6 +105,13 @@ def test_Point_init(args): assert isinstance(skia.Point(*args), skia.Point) +def test_Point_Offset(): + points = [skia.Point(1, 2), skia.Point(3, 4)] + points = skia.Point.Offset(points, 1, 1) + assert points[0].equals(2, 3) + assert points[1].equals(4, 5) + + def test_Point_x(point): assert point.x() == 4