Properly emit valueChanged in Rect setters
This commit is contained in:
		
							parent
							
								
									660cb9e05a
								
							
						
					
					
						commit
						abce6c94b0
					
				
					 2 changed files with 33 additions and 4 deletions
				
			
		
							
								
								
									
										24
									
								
								src/etc.cpp
									
										
									
									
									
								
							
							
						
						
									
										24
									
								
								src/etc.cpp
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -284,6 +284,30 @@ void Rect::empty()
 | 
			
		|||
	valueChanged();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Rect::setX(int value)
 | 
			
		||||
{
 | 
			
		||||
	x = value;
 | 
			
		||||
	valueChanged();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Rect::setY(int value)
 | 
			
		||||
{
 | 
			
		||||
	y = value;
 | 
			
		||||
	valueChanged();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Rect::setWidth(int value)
 | 
			
		||||
{
 | 
			
		||||
	width = value;
 | 
			
		||||
	valueChanged();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Rect::setHeight(int value)
 | 
			
		||||
{
 | 
			
		||||
	height = value;
 | 
			
		||||
	valueChanged();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int Rect::serialSize() const
 | 
			
		||||
{
 | 
			
		||||
	return 4 * 4;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										13
									
								
								src/etc.h
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								src/etc.h
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -165,10 +165,15 @@ struct Rect : public Serializable
 | 
			
		|||
		return !(x || y || width || height);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	DECL_ATTR_INLINE(X,      int, x)
 | 
			
		||||
	DECL_ATTR_INLINE(Y,      int, y)
 | 
			
		||||
	DECL_ATTR_INLINE(Width,  int, width)
 | 
			
		||||
	DECL_ATTR_INLINE(Height, int, height)
 | 
			
		||||
	void setX(int value);
 | 
			
		||||
	void setY(int value);
 | 
			
		||||
	void setWidth(int value);
 | 
			
		||||
	void setHeight(int value);
 | 
			
		||||
 | 
			
		||||
	int getX() const { return x; }
 | 
			
		||||
	int getY() const { return y; }
 | 
			
		||||
	int getWidth() const { return width; }
 | 
			
		||||
	int getHeight() const { return height; }
 | 
			
		||||
 | 
			
		||||
	int serialSize() const;
 | 
			
		||||
	void serialize(char *buffer) const;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue