-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
common: stroke dash offset support added #1607
Changes from all commits
f9d1019
0540849
a828e7c
046cedc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1316,18 +1316,12 @@ TVG_API Tvg_Result tvg_shape_get_stroke_gradient(const Tvg_Paint* paint, Tvg_Gra | |
|
||
|
||
/*! | ||
* \brief Sets the shape's stroke dash pattern. | ||
* | ||
* \code | ||
* //dash pattern examples | ||
* float dashPattern[2] = {20, 10}; // -- -- -- | ||
* float dashPattern[2] = {40, 20}; // ---- ---- ---- | ||
* float dashPattern[4] = {10, 20, 30, 40} // - --- - --- | ||
* \endcode | ||
* \brief Sets the shape's stroke dash pattern. (BETA_API) | ||
* | ||
* \param[in] paint A Tvg_Paint pointer to the shape object. | ||
* \param[in] dashPattern The array of consecutive pair values of the dash length and the gap length. | ||
* \param[in] cnt The size of the @p dashPattern array. | ||
* \param[in] offset The shift of the starting point within the repeating dash pattern from which the path's dashing begins. | ||
* | ||
* \return Tvg_Result enumeration. | ||
* \retval TVG_RESULT_SUCCESS Succeed. | ||
|
@@ -1336,23 +1330,24 @@ TVG_API Tvg_Result tvg_shape_get_stroke_gradient(const Tvg_Paint* paint, Tvg_Gra | |
* | ||
* \note To reset the stroke dash pattern, pass @c nullptr to @p dashPattern and zero to @p cnt. | ||
*/ | ||
TVG_API Tvg_Result tvg_shape_set_stroke_dash(Tvg_Paint* paint, const float* dashPattern, uint32_t cnt); | ||
TVG_API Tvg_Result tvg_shape_set_stroke_dash(Tvg_Paint* paint, const float* dashPattern, uint32_t cnt, float offset); | ||
|
||
|
||
/*! | ||
* \brief Gets the dash pattern of the stroke. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hermet I added BETA_API - not sure whether it's necessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you think it's ready to official release then you don't need to add BETA_API tag. Otherwise you should. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, now this breaks the api compatibility. |
||
* \brief Gets the dash pattern of the stroke. (BETA_API) | ||
* | ||
* The function does not allocate any memory. | ||
* | ||
* \param[in] paint A Tvg_Paint pointer to the shape object. | ||
* \param[out] dashPattern The array of consecutive pair values of the dash length and the gap length. | ||
* \param[out] cnt The size of the @p dashPattern array. | ||
* \param[out] offset The shift of the starting point within the repeating dash pattern. | ||
* | ||
* \return Tvg_Result enumeration. | ||
* \retval TVG_RESULT_SUCCESS Succeed. | ||
* \retval TVG_RESULT_INVALID_ARGUMENT An invalid pointer passed as an argument. | ||
*/ | ||
TVG_API Tvg_Result tvg_shape_get_stroke_dash(const Tvg_Paint* paint, const float** dashPattern, uint32_t* cnt); | ||
TVG_API Tvg_Result tvg_shape_get_stroke_dash(const Tvg_Paint* paint, const float** dashPattern, uint32_t* cnt, float* offset); | ||
|
||
|
||
/*! | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hermet our policy is that we can remove the def value from api just like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have two options:
You know, you already suggested this change. I have no any objection of this.
Abou policy? Well... you know most apis have no default values but if it's useful for users then why not?