common stroke: retype the stroke width from size_t to float 93/235193/1
authorHermet Park <chuneon.park@samsung.com>
Tue, 2 Jun 2020 11:58:50 +0000 (20:58 +0900)
committerHermet Park <chuneon.park@samsung.com>
Tue, 2 Jun 2020 11:58:50 +0000 (20:58 +0900)
Change-Id: I812d06d2037d66408c41d50f7c1ff7ba605558bd

inc/tizenvg.h
src/lib/tvgShape.cpp
src/lib/tvgShapeImpl.h

index 05f1927..c113975 100644 (file)
@@ -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;
index a17c53b..fe95eac 100644 (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();
     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;
 }
 
index 682c29b..05be16d 100644 (file)
@@ -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?