From ef9f31577e0fbf94a0135b827e84750be5673f2b Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Tue, 2 Jun 2020 20:58:50 +0900 Subject: [PATCH] common stroke: retype the stroke width from size_t to float Change-Id: I812d06d2037d66408c41d50f7c1ff7ba605558bd --- inc/tizenvg.h | 4 ++-- src/lib/tvgShape.cpp | 6 +++--- src/lib/tvgShapeImpl.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/inc/tizenvg.h b/inc/tizenvg.h index 05f19273..c113975b 100644 --- a/inc/tizenvg.h +++ b/inc/tizenvg.h @@ -141,7 +141,7 @@ public: int appendPath(const PathCommand* cmds, size_t cmdCnt, const Point* pts, size_t ptsCnt) noexcept; //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(const size_t* dashPattern, size_t cnt) 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 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; size_t strokeDash(const size_t** dashPattern) const noexcept; StrokeCap strokeCap() const noexcept; diff --git a/src/lib/tvgShape.cpp b/src/lib/tvgShape.cpp index a17c53b0..fe95eac2 100644 --- a/src/lib/tvgShape.cpp +++ b/src/lib/tvgShape.cpp @@ -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(); 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(); assert(impl); - if (!impl->stroke) return -1; + if (!impl->stroke) return 0; return impl->stroke->width; } diff --git a/src/lib/tvgShapeImpl.h b/src/lib/tvgShapeImpl.h index 682c29b7..05be16d2 100644 --- a/src/lib/tvgShapeImpl.h +++ b/src/lib/tvgShapeImpl.h @@ -30,7 +30,7 @@ struct ShapeFill struct ShapeStroke { - size_t width = 0; + float width = 0; size_t color[4] = {0, 0, 0, 0}; size_t* dashPattern = nullptr; size_t dashCnt = 0; @@ -153,7 +153,7 @@ struct Shape::Impl return 0; } - bool strokeWidth(size_t width) + bool strokeWidth(float width) { //TODO: Size Exception?