Pārlūkot izejas kodu

Experimental fix for excluding margins from view 'hit' zones.

Mark Sibly 8 gadi atpakaļ
vecāks
revīzija
428414b49b
2 mainītis faili ar 9 papildinājumiem un 12 dzēšanām
  1. 5 8
      modules/mojo/app/style.monkey2
  2. 4 4
      modules/mojo/app/view.monkey2

+ 5 - 8
modules/mojo/app/style.monkey2

@@ -150,11 +150,10 @@ Class Style
 	#rem monkeydoc Total style bounds.
 	#end
 	Property Bounds:Recti()
-		Local bounds:=Padding
-		Local skin:=Skin
-		If skin bounds+=Skin.Bounds
-		bounds+=Border
-		bounds+=Margin
+		Local bounds:=_padding
+		If _skin bounds+=_skin.Bounds
+		bounds+=_border
+		bounds+=_margin
 		Return bounds
 	End
 
@@ -235,12 +234,10 @@ Class Style
 		canvas.Color=color
 	End
 	
-	#rem monkeydoc @hidden
+	#rem monkeydoc @hidden 
 	#end
 	Method Render( canvas:Canvas,bounds:Recti )
 
-		bounds-=Margin
-		
 		Local border:=Border
 		Local bdcolor:=BorderColor
 		

+ 4 - 4
modules/mojo/app/view.monkey2

@@ -374,7 +374,7 @@ Class View
 	Method FindViewAtWindowPoint:View( point:Vec2i )
 	
 		If Not _visible Return Null
-	
+		
 		If Not _rbounds.Contains( point ) Return Null
 		
 		For Local i:=0 Until _children.Length
@@ -693,15 +693,15 @@ Class View
 			_matrix=_matrix.Scale( sc,sc )
 			
 		End
-
+		
 		_matrix=_matrix.Translate( -_bounds.min.x,-_bounds.min.y )
 		
 		If _parent _rmatrix=_parent._rmatrix * _matrix Else _rmatrix=_matrix
 		
-'		_rmatrix.t.x=Round( _rmatrix.t.x )
-'		_rmatrix.t.y=Round( _rmatrix.t.y )
+		_bounds-=_rstyle.Margin
 		
 		_rclip=TransformRecti( _rect,_rmatrix )
+		
 		_rbounds=TransformRecti( _bounds,_rmatrix )
 		
 		If _parent