mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-22 06:41:08 +00:00
Add gfx/rect_io.h
This commit is contained in:
parent
24e0939ad2
commit
9df732e27b
27
src/gfx/rect_io.h
Normal file
27
src/gfx/rect_io.h
Normal file
@ -0,0 +1,27 @@
|
||||
// Aseprite Gfx Library
|
||||
// Copyright (C) 2001-2014 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
|
||||
#ifndef GFX_RECT_IO_H_INCLUDED
|
||||
#define GFX_RECT_IO_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "gfx/rect.h"
|
||||
#include <iosfwd>
|
||||
|
||||
namespace gfx {
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const Rect& rect)
|
||||
{
|
||||
return os << "("
|
||||
<< rect.x << ", "
|
||||
<< rect.y << ", "
|
||||
<< rect.w << ", "
|
||||
<< rect.h << ")";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -6,26 +6,14 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "gfx/rect.h"
|
||||
#include "gfx/size.h"
|
||||
#include "gfx/border.h"
|
||||
#include "gfx/rect.h"
|
||||
#include "gfx/rect_io.h"
|
||||
#include "gfx/size.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace gfx;
|
||||
|
||||
namespace gfx {
|
||||
|
||||
ostream& operator<<(ostream& os, const Rect& rect)
|
||||
{
|
||||
return os << "("
|
||||
<< rect.x << ", "
|
||||
<< rect.y << ", "
|
||||
<< rect.w << ", "
|
||||
<< rect.h << ")";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TEST(Rect, Ctor)
|
||||
{
|
||||
EXPECT_EQ(Rect(0, 0, 0, 0), Rect());
|
||||
|
Loading…
x
Reference in New Issue
Block a user