Skip to content

Commit

Permalink
fix test case bad version
Browse files Browse the repository at this point in the history
  • Loading branch information
libpag-pag authored and Hparty committed Dec 6, 2024
1 parent 3f8c1d5 commit cd18289
Show file tree
Hide file tree
Showing 3 changed files with 613 additions and 606 deletions.
3 changes: 3 additions & 0 deletions src/rendering/filters/layerstyle/SolidStrokeFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ std::shared_ptr<tgfx::RuntimeEffect> SolidStrokeFilter::onCreateEffect(
newOption.spreadSizeY *= filterScale.y;
newOption.offsetX *= filterScale.x;
newOption.offsetY *= filterScale.y;
if (!newOption.valid()) {
return nullptr;
}
if (styleMode == SolidStrokeMode::Normal) {
return SolidStrokeNormalEffect::Make(newOption, originalImage);
} else {
Expand Down
4 changes: 4 additions & 0 deletions src/rendering/filters/layerstyle/SolidStrokeFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ struct SolidStrokeOption {
float spreadSizeY = 0.0f;
float offsetX = 0.0f;
float offsetY = 0.0f;

bool valid() {
return opacity != 0 && (spreadSizeX != 0 || spreadSizeY !=0 || offsetX != 0 || offsetY != 0);
}
};

class SolidStrokeUniforms : public Uniforms {
Expand Down
Loading

0 comments on commit cd18289

Please sign in to comment.