fix(TouchHandler): touch point offset due to status bar (#1012)

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
This commit is contained in:
Eric Rozell 2017-02-16 17:11:34 -05:00 коммит произвёл GitHub
Родитель fdfa920ba6
Коммит 34b1dfcce6
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -6,6 +6,7 @@ using System;
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;
@ -303,7 +304,10 @@ namespace ReactNative.Touch
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;