mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
sw_engine: fix stroke miterlimit precision
Since the value was casted to int the results were different than expected.
This commit is contained in:
parent
400511c123
commit
58e24f63a4
1 changed files with 2 additions and 2 deletions
|
@ -238,7 +238,7 @@ static void _outside(SwStroke& stroke, int32_t side, SwFixed lineLength)
|
||||||
} else {
|
} else {
|
||||||
//this is a mitered (pointed) or beveled (truncated) corner
|
//this is a mitered (pointed) or beveled (truncated) corner
|
||||||
auto rotate = SIDE_TO_ROTATE(side);
|
auto rotate = SIDE_TO_ROTATE(side);
|
||||||
auto bevel = (stroke.join == StrokeJoin::Bevel) ? true : false;
|
auto bevel = stroke.join == StrokeJoin::Bevel;
|
||||||
SwFixed phi = 0;
|
SwFixed phi = 0;
|
||||||
SwFixed thcos = 0;
|
SwFixed thcos = 0;
|
||||||
|
|
||||||
|
@ -816,7 +816,7 @@ void strokeReset(SwStroke* stroke, const RenderShape* rshape, const Matrix* tran
|
||||||
|
|
||||||
stroke->width = HALF_STROKE(rshape->strokeWidth());
|
stroke->width = HALF_STROKE(rshape->strokeWidth());
|
||||||
stroke->cap = rshape->strokeCap();
|
stroke->cap = rshape->strokeCap();
|
||||||
stroke->miterlimit = static_cast<SwFixed>(rshape->strokeMiterlimit()) << 16;
|
stroke->miterlimit = static_cast<SwFixed>(rshape->strokeMiterlimit() * 65536.0f);
|
||||||
|
|
||||||
//Save line join: it can be temporarily changed when stroking curves...
|
//Save line join: it can be temporarily changed when stroking curves...
|
||||||
stroke->joinSaved = stroke->join = rshape->strokeJoin();
|
stroke->joinSaved = stroke->join = rshape->strokeJoin();
|
||||||
|
|
Loading…
Add table
Reference in a new issue