Skip to content

Commit 0c8064c

Browse files
committed
update PointAt to return tuple(BPoint,float)
1 parent 526d889 commit 0c8064c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bindings/interface/TextView.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,12 @@ py::class_<BTextView, PyBTextView, BView, std::unique_ptr<BTextView,py::nodelete
254254
.def("RunArray", &BTextView::RunArray, "", py::arg("startOffset"), py::arg("endOffset"), py::arg("_size")=NULL)
255255
.def("LineAt", py::overload_cast<int32>(&BTextView::LineAt,py::const_), "", py::arg("offset"))
256256
.def("LineAt", py::overload_cast<BPoint>(&BTextView::LineAt,py::const_), "", py::arg("point"))
257-
.def("PointAt", &BTextView::PointAt, "", py::arg("offset"), py::arg("_height")=NULL)
257+
//.def("PointAt", &BTextView::PointAt, "", py::arg("offset"), py::arg("_height")=NULL)
258+
.def("PointAt", [](BTextView& self, int32 offset) -> std::tuple<BPoint,float> {
259+
float height;
260+
BPoint ret = self.PointAt(offset,&height);
261+
return std::make_tuple(ret,height);
262+
},"",py::arg("offset"))
258263
.def("OffsetAt", py::overload_cast<BPoint>(&BTextView::OffsetAt,py::const_), "", py::arg("point"))
259264
.def("OffsetAt", py::overload_cast<int32>(&BTextView::OffsetAt,py::const_), "", py::arg("line"))
260265
.def("FindWord", &BTextView::FindWord, "", py::arg("offset"), py::arg("_fromOffset"), py::arg("_toOffset"))

0 commit comments

Comments
 (0)