tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsTransform2D.cpp (819B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "nsTransform2D.h"
      8 
      9 void nsTransform2D ::TransformCoord(nscoord* ptX, nscoord* ptY) const {
     10  *ptX = NSToCoordRound(*ptX * m00 + m20);
     11  *ptY = NSToCoordRound(*ptY * m11 + m21);
     12 }
     13 
     14 void nsTransform2D ::TransformCoord(nscoord* aX, nscoord* aY, nscoord* aWidth,
     15                                    nscoord* aHeight) const {
     16  nscoord x2 = *aX + *aWidth;
     17  nscoord y2 = *aY + *aHeight;
     18  TransformCoord(aX, aY);
     19  TransformCoord(&x2, &y2);
     20  *aWidth = x2 - *aX;
     21  *aHeight = y2 - *aY;
     22 }