From 226ff3089ad977f2f8c6d4a7830e17d7ebbdfde1 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Thu, 12 Dec 2019 17:33:02 +0800 Subject: [PATCH] feat:add getLocationOnScreen --- Pod/Classes/Shader/DoricViewNode.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Pod/Classes/Shader/DoricViewNode.m b/Pod/Classes/Shader/DoricViewNode.m index f1beff00..8b9d06f4 100644 --- a/Pod/Classes/Shader/DoricViewNode.m +++ b/Pod/Classes/Shader/DoricViewNode.m @@ -317,6 +317,11 @@ - (NSNumber *)getHeight { return @(self.view.height); } +- (NSDictionary *)getLocationOnScreen { + CGPoint point = [self.view convertPoint:CGPointMake(0, 0) toView:[UIApplication sharedApplication].windows.lastObject]; + return @{@"x": @(point.x), @"y": @(point.y)}; +} + - (void)blendLayoutConfig:(NSDictionary *)params { [params[@"widthSpec"] also:^(NSNumber *it) { if (it) {