mirror of
https://gitee.com/idea4good/GuiLite.git
synced 2026-01-02 12:27:22 +08:00
refactor folder
This commit is contained in:
27
workspace/core_include/rect.h
Normal file
27
workspace/core_include/rect.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef GUILITE_CORE_INCLUDE_RECT_H
|
||||
#define GUILITE_CORE_INCLUDE_RECT_H
|
||||
|
||||
class c_rect
|
||||
{
|
||||
public:
|
||||
c_rect(){Empty();}
|
||||
c_rect(int left, int top, int right, int bottom){m_left = left;m_top = top;m_right = right;m_bottom = bottom;};
|
||||
void SetRect( int left, int top, int right, int bottom);
|
||||
c_rect(const c_rect&);
|
||||
c_rect& operator=(const c_rect&);
|
||||
void Empty();
|
||||
void Offset(int x, int y);
|
||||
int IsEmpty() const ;
|
||||
int PtInRect(int x, int y) const ;
|
||||
int operator==(const c_rect& ) const;
|
||||
c_rect operator&(const c_rect& aRect) const;
|
||||
int Width() const {return m_right - m_left + 1;}
|
||||
int Height() const {return m_bottom - m_top + 1;}
|
||||
|
||||
int m_left;
|
||||
int m_top;
|
||||
int m_right;
|
||||
int m_bottom;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user