File: Region.cpp

package info (click to toggle)
hyprutils 0.11.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 560 kB
  • sloc: cpp: 5,332; sh: 10; makefile: 3
file content (18 lines) | stat: -rw-r--r-- 445 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <hyprutils/math/Region.hpp>

#include <gtest/gtest.h>

using namespace Hyprutils::Math;

TEST(Math, region) {
    CRegion rg(CBox{{20, 20}, {40, 40}});

    auto    extents = rg.getExtents();
    EXPECT_EQ(extents.pos(), Vector2D(20, 20));
    EXPECT_EQ(extents.size(), Vector2D(40, 40));

    rg.scale(2);
    extents = rg.getExtents();
    EXPECT_EQ(extents.pos(), Vector2D(40, 40));
    EXPECT_EQ(extents.size(), Vector2D(80, 80));
}