agg::trans_affine: add static const identity
, make mul/div operators const
(cherry picked from commit db47a6c9bad5828fe62b5c1c05661118e23ad218)
This commit is contained in:
parent
46c2d1c710
commit
d346c57e17
2 changed files with 6 additions and 4 deletions
9
deps/agg/include/agg_trans_affine.h
vendored
9
deps/agg/include/agg_trans_affine.h
vendored
|
@ -86,6 +86,7 @@ namespace agg
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
struct trans_affine
|
struct trans_affine
|
||||||
{
|
{
|
||||||
|
static const trans_affine identity;
|
||||||
double sx, shy, shx, sy, tx, ty;
|
double sx, shy, shx, sy, tx, ty;
|
||||||
|
|
||||||
//------------------------------------------ Construction
|
//------------------------------------------ Construction
|
||||||
|
@ -210,15 +211,15 @@ namespace agg
|
||||||
}
|
}
|
||||||
|
|
||||||
// Multiply the matrix by another one and return
|
// Multiply the matrix by another one and return
|
||||||
// the result in a separete matrix.
|
// the result in a separate matrix.
|
||||||
trans_affine operator * (const trans_affine& m)
|
trans_affine operator * (const trans_affine& m) const
|
||||||
{
|
{
|
||||||
return trans_affine(*this).multiply(m);
|
return trans_affine(*this).multiply(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Multiply the matrix by inverse of another one
|
// Multiply the matrix by inverse of another one
|
||||||
// and return the result in a separete matrix.
|
// and return the result in a separate matrix.
|
||||||
trans_affine operator / (const trans_affine& m)
|
trans_affine operator / (const trans_affine& m) const
|
||||||
{
|
{
|
||||||
return trans_affine(*this).multiply_inv(m);
|
return trans_affine(*this).multiply_inv(m);
|
||||||
}
|
}
|
||||||
|
|
1
deps/agg/src/agg_trans_affine.cpp
vendored
1
deps/agg/src/agg_trans_affine.cpp
vendored
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
namespace agg
|
namespace agg
|
||||||
{
|
{
|
||||||
|
const trans_affine trans_affine::identity;
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
const trans_affine& trans_affine::parl_to_parl(const double* src,
|
const trans_affine& trans_affine::parl_to_parl(const double* src,
|
||||||
|
|
Loading…
Reference in a new issue