mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-25 02:04:23 +00:00
Fixed some obscure rounding errors in Rectangle.
This commit is contained in:
parent
32c98223ac
commit
8c7a35addb
1 changed files with 4 additions and 4 deletions
|
|
@ -698,10 +698,10 @@ public:
|
|||
template <typename IntType>
|
||||
Rectangle<IntType> getSmallestIntegerContainerWithType() const noexcept
|
||||
{
|
||||
const IntType x1 = static_cast <IntType> (std::floor (static_cast<float> (pos.x)));
|
||||
const IntType y1 = static_cast <IntType> (std::floor (static_cast<float> (pos.y)));
|
||||
const IntType x2 = static_cast <IntType> (std::ceil (static_cast<float> (pos.x + w)));
|
||||
const IntType y2 = static_cast <IntType> (std::ceil (static_cast<float> (pos.y + h)));
|
||||
const IntType x1 = static_cast<IntType> (std::floor (pos.x));
|
||||
const IntType y1 = static_cast<IntType> (std::floor (pos.y));
|
||||
const IntType x2 = static_cast<IntType> (std::ceil (pos.x + w));
|
||||
const IntType y2 = static_cast<IntType> (std::ceil (pos.y + h));
|
||||
|
||||
return Rectangle<IntType> (x1, y1, x2 - x1, y2 - y1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue