Skip to content

Commit

Permalink
fix(TouchHandler): touch point offset due to status bar (#1012)
Browse files Browse the repository at this point in the history
A previous change to adjust the touch point for a visible status bar does not seem to be necessary when the device is in landscape orientation.

Fixes #945
  • Loading branch information
rozele committed Mar 6, 2017
1 parent 21ec10c commit c92c602
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ReactWindows/ReactNative/Touch/TouchHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Generic;
using Windows.Foundation;
using Windows.Foundation.Metadata;
using Windows.Graphics.Display;
using Windows.UI.Input;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
Expand Down Expand Up @@ -303,7 +304,10 @@ private static bool ShouldSendEnterLeaveEvent(DependencyObject view)

private static Point AdjustPointForStatusBar(Point point)
{
if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
var currentOrientation = DisplayInformation.GetForCurrentView().CurrentOrientation;
if (currentOrientation != DisplayOrientations.Landscape &&
currentOrientation != DisplayOrientations.LandscapeFlipped &&
ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
var rect = StatusBar.GetForCurrentView().OccludedRect;
point.Y += rect.Height;
Expand Down

0 comments on commit c92c602

Please sign in to comment.