add Measure conversion
This commit is contained in:
parent
559a9529dd
commit
b49ac99a07
@ -166,6 +166,8 @@ const BBox = Measures.Absolute2DBox
|
|||||||
const px = AbsoluteLength(0.254)
|
const px = AbsoluteLength(0.254)
|
||||||
const pct = Length{:pct,Float64}(1.0)
|
const pct = Length{:pct,Float64}(1.0)
|
||||||
|
|
||||||
|
Base.convert(::Type{<:Measure}, x::Float64) = x * pct
|
||||||
|
|
||||||
Base.:*(m1::AbsoluteLength, m2::Length{:pct}) = AbsoluteLength(m1.value * m2.value)
|
Base.:*(m1::AbsoluteLength, m2::Length{:pct}) = AbsoluteLength(m1.value * m2.value)
|
||||||
Base.:*(m1::Length{:pct}, m2::AbsoluteLength) = AbsoluteLength(m2.value * m1.value)
|
Base.:*(m1::Length{:pct}, m2::AbsoluteLength) = AbsoluteLength(m2.value * m1.value)
|
||||||
Base.:/(m1::AbsoluteLength, m2::Length{:pct}) = AbsoluteLength(m1.value / m2.value)
|
Base.:/(m1::AbsoluteLength, m2::Length{:pct}) = AbsoluteLength(m1.value / m2.value)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user