Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a2433ce authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Add comment for unknown rotation type

Layers with rotation 0/90/180/270 are marked with type ROTATION, layers
with other rotation values (free rotation) are marked as UNKNOWN, added
explanation to prevent doubts about the method

Test: Nothing to test, just added a comment to the code
Change-Id: I4d61ae00cda763c37b5526917e40a9509990a0f4
parent c16140fd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -95,6 +95,9 @@ void LayerProtoHelper::writeToProto(const ui::Transform& transform,
    const uint32_t type = transform.getType() | (transform.getOrientation() << 8);
    transformProto->set_type(type);

    // Rotations that are 90/180/270 have their own type so the transform matrix can be
    // reconstructed later. All other rotation have the type UKNOWN so we need to save the transform
    // values in that case.
    if (type & (ui::Transform::SCALE | ui::Transform::UNKNOWN)) {
        transformProto->set_dsdx(transform[0][0]);
        transformProto->set_dtdx(transform[0][1]);