示例#1
0
		/// <summary>Called when a scrollwheel changes by the given delta amount.</summary>
		public static void OnScrollWheel(Vector2 delta){
			
			// Create the event:
			WheelEvent e=new WheelEvent();
			e.deltaX=delta.x * ScrollWheelMultiplier;
			e.deltaY=delta.y * ScrollWheelMultiplier;
			e.SetTrusted();
			
			EventTarget target=ActiveReceiver;
			
			if(target == Unhandled){
				// It's going to be wasted, so let's try the moused over element first.
				if(SystemMouse!=null && SystemMouse.ActiveOverTarget!=null){
					// Send it there instead:
					target = SystemMouse.ActiveOverTarget;
				}
			}
			
			// Dispatch the event to the focused element:
			if(target.dispatchEvent(e)){
				
				HtmlElement htmlTarget = (target as HtmlElement);
				
				if(htmlTarget!=null){
					// Run the default:
					htmlTarget.OnWheelEvent(e);
				}
				
			}
			
		}