private void OnScrollWheel(WheelEvent evt) { if (this.contentContainer.layout.height - base.layout.height > 0f) { if (evt.delta.y < 0f) { this.verticalScroller.ScrollPageUp(); } else if (evt.delta.y > 0f) { this.verticalScroller.ScrollPageDown(); } } evt.StopPropagation(); }
// TODO: Same behaviour as IMGUI Scroll view; it would probably be nice to show same behaviour // as Web browsers, which give back event to parent if not consumed void OnScrollWheel(WheelEvent evt) { if (contentContainer.layout.height - layout.height > 0) { if (evt.delta.y < 0) { verticalScroller.ScrollPageUp(Mathf.Abs(evt.delta.y)); } else if (evt.delta.y > 0) { verticalScroller.ScrollPageDown(Mathf.Abs(evt.delta.y)); } } evt.StopPropagation(); }