There was no way to modify or remote previously added path information.
The user can update the shape by deleting the path information
and adding a new path information by using ResetPath() API.
Change-Id: Ia5a6484877aa410c18ba6c53d72bc65c77ad09fa
return GetImplementation(*this).Close();
}
+bool CanvasRenderer::Shape::ResetPath()
+{
+ return GetImplementation(*this).ResetPath();
+}
+
bool CanvasRenderer::Shape::SetFillColor(Vector4 color)
{
return GetImplementation(*this).SetFillColor(color);
*/
bool Close();
+ /**
+ * @brief Reset the added path(rect, circle, path, etc...) information.
+ * Color and Stroke information are keeped.
+ * @return Returns True when it's successful. False otherwise.
+ */
+ bool ResetPath();
+
/**
* @brief Set the color to use for filling the path.
* @param[in] color The color value.
return false;
}
+bool Shape::ResetPath()
+{
+ return false;
+}
+
bool Shape::SetFillColor(Vector4 color)
{
return false;
virtual bool AddCubicTo(Vector2 controlPoint1, Vector2 controlPoint2, Vector2 endPoint);
/**
- * @copydoc Dali::CanvasRenderer::Shape::AddClose
+ * @copydoc Dali::CanvasRenderer::Shape::Close
*/
virtual bool Close();
+ /**
+ * @copydoc Dali::CanvasRenderer::Shape::ResetPath
+ */
+ virtual bool ResetPath();
+
/**
* @copydoc Dali::CanvasRenderer::Shape::SetFillColor
*/
#endif
}
+bool ShapeTizen::ResetPath()
+{
+#ifdef THORVG_SUPPORT
+ if(!mTvgShape)
+ {
+ DALI_LOG_ERROR("Shape is null\n");
+ return false;
+ }
+
+ if(static_cast<tvg::Shape*>(mTvgShape)->reset() != tvg::Result::Success)
+ {
+ DALI_LOG_ERROR("reset() fail.\n");
+ return false;
+ }
+ Drawable::SetChanged(true);
+ return true;
+#else
+ return false;
+#endif
+}
+
bool ShapeTizen::SetFillColor(Vector4 color)
{
#ifdef THORVG_SUPPORT
*/
bool Close() override;
+ /**
+ * @copydoc Dali::CanvasRenderer::Shape::ResetPath
+ */
+ bool ResetPath() override;
+
/**
* @copydoc Dali::CanvasRenderer::Shape::SetFillColor
*/
#endif
}
+bool ShapeUbuntu::ResetPath()
+{
+#ifdef THORVG_SUPPORT
+ if(!mTvgShape)
+ {
+ DALI_LOG_ERROR("Shape is null\n");
+ return false;
+ }
+
+ if(static_cast<tvg::Shape*>(mTvgShape)->reset() != tvg::Result::Success)
+ {
+ DALI_LOG_ERROR("reset() fail.\n");
+ return false;
+ }
+ Drawable::SetChanged(true);
+ return true;
+#else
+ return false;
+#endif
+}
+
bool ShapeUbuntu::SetFillColor(Vector4 color)
{
#ifdef THORVG_SUPPORT
*/
bool Close() override;
+ /**
+ * @copydoc Dali::CanvasRenderer::Shape::ResetPath
+ */
+ bool ResetPath() override;
+
/**
* @copydoc Dali::CanvasRenderer::Shape::SetFillColor
*/