| 885 | } |
| 886 | |
| 887 | Rect Layer::convertRectToParent(const Rect& rect) { |
| 888 | // TODO(simon): Take in account rotation |
| 889 | |
| 890 | if (_hasScale) { |
| 891 | auto convertedRect = |
| 892 | Rect::makeXYWH(rect.left * _scaleX, rect.top * _scaleY, rect.width() * _scaleX, rect.height() * _scaleY); |
| 893 | |
| 894 | auto offset = getOffsetInParent(); |
| 895 | return convertedRect.makeOffset(offset.x, offset.y); |
| 896 | } else { |
| 897 | return rect.makeOffset(_frame.left + _translation.width, _frame.top + _translation.height); |
| 898 | } |
| 899 | } |
| 900 | |
| 901 | Point Layer::convertPointToParent(const Point& point) { |
| 902 | // TODO(simon): Take in account rotation |
no test coverage detected