| 186 | {} |
| 187 | |
| 188 | m2::RectD SquareHandle::GetPixelRect(ScreenBase const & screen, bool perspective) const |
| 189 | { |
| 190 | if (perspective) |
| 191 | return GetPixelRectPerspective(screen); |
| 192 | |
| 193 | m2::PointD const pxPivot = screen.GtoP(m_gbPivot) + m_pxOffset; |
| 194 | m2::RectD result(pxPivot - m_pxHalfSize, pxPivot + m_pxHalfSize); |
| 195 | m2::PointD offset(0.0, 0.0); |
| 196 | |
| 197 | if (m_anchor & dp::Left) |
| 198 | offset.x = m_pxHalfSize.x; |
| 199 | else if (m_anchor & dp::Right) |
| 200 | offset.x = -m_pxHalfSize.x; |
| 201 | |
| 202 | if (m_anchor & dp::Top) |
| 203 | offset.y = m_pxHalfSize.y; |
| 204 | else if (m_anchor & dp::Bottom) |
| 205 | offset.y = -m_pxHalfSize.y; |
| 206 | |
| 207 | result.Offset(offset); |
| 208 | return result; |
| 209 | } |
| 210 | |
| 211 | void SquareHandle::GetPixelShape(ScreenBase const & screen, bool perspective, Rects & rects) const |
| 212 | { |
no test coverage detected