summaryrefslogtreecommitdiff
path: root/src/client/layer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/layer.c')
-rwxr-xr-xsrc/client/layer.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/client/layer.c b/src/client/layer.c
index 5aa8124..770a916 100755
--- a/src/client/layer.c
+++ b/src/client/layer.c
@@ -158,9 +158,8 @@ void drawLayerSplit(int local_x, int local_y, int x, int y, int w, int h)
if( local_x + (this->x - x) < local_x )
{
- //this->x = local_x;
int z;
- z = ( local_x + (this->x - x) + this->w ) - local_x;
+
z = local_x - ( local_x + (this->x - x) );
this->x += z;
@@ -173,6 +172,22 @@ void drawLayerSplit(int local_x, int local_y, int x, int y, int w, int h)
this->w -= ( local_x + (this->x - x) + this->w ) - (local_x + w);
}
+ if( local_y + (this->y - y) < local_y )
+ {
+ int z;
+
+ z = local_y - ( local_y + (this->y - y) );
+
+ this->y += z;
+ this->py += z;
+ this->h -= z;
+ }
+
+ if( local_y + (this->y - y) + this->h > local_y+h )
+ {
+ this->h -= ( local_y + (this->y - y) + this->h ) - (local_y + h);
+ }
+
drawImage(this->image,
local_x + (this->x - x), local_y + (this->y - y),
this->px, this->py,