MCPcopy Create free account
hub / github.com/Snapchat/Valdi / convertPointToParent

Method convertPointToParent

snap_drawing/src/snap_drawing/cpp/Layers/Layer.cpp:901–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

899}
900
901Point Layer::convertPointToParent(const Point& point) {
902 // TODO(simon): Take in account rotation
903
904 if (_hasScale) {
905 auto convertedPoint = Point::make(point.x * _scaleX, point.y * _scaleY);
906
907 auto offset = getOffsetInParent();
908 return convertedPoint.makeOffset(offset.x, offset.y);
909 } else {
910 return point.makeOffset(_frame.left + _translation.width, _frame.top + _translation.height);
911 }
912}
913
914void Layer::setVisualFrameDirty() {
915 _visualFrameDirty = true;

Callers

nothing calls this directly

Calls 1

makeOffsetMethod · 0.45

Tested by

no test coverage detected