common stroke: retype the stroke width from size_t to float

Change-Id: I812d06d2037d66408c41d50f7c1ff7ba605558bd
This commit is contained in:
Hermet Park 2020-06-02 20:58:50 +09:00
parent 8614a2efee
commit ef9f31577e
3 changed files with 7 additions and 7 deletions

View file

@ -141,7 +141,7 @@ public:
int appendPath(const PathCommand* cmds, size_t cmdCnt, const Point* pts, size_t ptsCnt) noexcept; int appendPath(const PathCommand* cmds, size_t cmdCnt, const Point* pts, size_t ptsCnt) noexcept;
//Stroke //Stroke
int stroke(size_t width) noexcept; int stroke(float width) noexcept;
int stroke(size_t r, size_t g, size_t b, size_t a) noexcept; int stroke(size_t r, size_t g, size_t b, size_t a) noexcept;
int stroke(const size_t* dashPattern, size_t cnt) noexcept; int stroke(const size_t* dashPattern, size_t cnt) noexcept;
int stroke(StrokeCap cap) noexcept; int stroke(StrokeCap cap) noexcept;
@ -161,7 +161,7 @@ public:
int fill(size_t* r, size_t* g, size_t* b, size_t* a) const noexcept; int fill(size_t* r, size_t* g, size_t* b, size_t* a) const noexcept;
int bounds(float* x, float* y, float* w, float* h) const noexcept override; int bounds(float* x, float* y, float* w, float* h) const noexcept override;
size_t strokeWidth() const noexcept; float strokeWidth() const noexcept;
int strokeColor(size_t* r, size_t* g, size_t* b, size_t* a) const noexcept; int strokeColor(size_t* r, size_t* g, size_t* b, size_t* a) const noexcept;
size_t strokeDash(const size_t** dashPattern) const noexcept; size_t strokeDash(const size_t** dashPattern) const noexcept;
StrokeCap strokeCap() const noexcept; StrokeCap strokeCap() const noexcept;

View file

@ -280,7 +280,7 @@ int Shape::bounds(float* x, float* y, float* w, float* h) const noexcept
} }
int Shape::stroke(size_t width) noexcept int Shape::stroke(float width) noexcept
{ {
auto impl = pImpl.get(); auto impl = pImpl.get();
assert(impl); assert(impl);
@ -291,12 +291,12 @@ int Shape::stroke(size_t width) noexcept
} }
size_t Shape::strokeWidth() const noexcept float Shape::strokeWidth() const noexcept
{ {
auto impl = pImpl.get(); auto impl = pImpl.get();
assert(impl); assert(impl);
if (!impl->stroke) return -1; if (!impl->stroke) return 0;
return impl->stroke->width; return impl->stroke->width;
} }

View file

@ -30,7 +30,7 @@ struct ShapeFill
struct ShapeStroke struct ShapeStroke
{ {
size_t width = 0; float width = 0;
size_t color[4] = {0, 0, 0, 0}; size_t color[4] = {0, 0, 0, 0};
size_t* dashPattern = nullptr; size_t* dashPattern = nullptr;
size_t dashCnt = 0; size_t dashCnt = 0;
@ -153,7 +153,7 @@ struct Shape::Impl
return 0; return 0;
} }
bool strokeWidth(size_t width) bool strokeWidth(float width)
{ {
//TODO: Size Exception? //TODO: Size Exception?