On Thu, 2023-02-23 at 14:02 +0100, Francesco Pretto wrote:
> But if also GetView() can be confusing, and we
> don't want to name it more specifically, we can be more conservative
> an have GetString() instead.
Hi,
maybe Path::GetContent(), or Path::AsString()? As the GetString() feels
like there might be also SetString() (which it should, right? When one
wants to re-apply the path with this higher level API - the Path object
currently does not seem to be capable of "filling existing data" to it,
neither merge it with another Path object). I mean, the string is not
enough, if you cannot apply it anywhere - it would be nice to have a
higher level API for it.
> PdfPainter::Draw... like functions will really do stroke/fill right
> after the call, so it doesn't mix well with the concept of "under
> construction".
Yes, that's okay. I'm not sure we are on the same page. I meant
something like:
void PdfPainter::addRectangle(double x, double y,
double width, double height,
double roundX, double roundY)
{
PdfPainterPath path;
path.AddRectangle(x, y, width, height, roundX, roundY);
PdfPainter::DrawPath(path, the_right_mode);
// do something with m_StateStack.Current->CurrentPoint
}
instead of
{
PoDoFo::WriteRectangle(m_stream, x, y, width, height,
roundX, roundY, m_StateStack.Current->CurrentPoint);
}
just to re-use the Path class. You know, to limit different code paths.
It should be easier for testing too, and it might be a bit more
consistent, due to no shortcuts in the code, which is supposed to do
exactly the same thing as another part of the code.
Bye,
zyx
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users