View unanswered posts | View active topics It is currently 2020-05-26 7:11



This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
 怎么判断一个网元位于屏幕之外?(即需要拖拉滚动条才可见) 
Author Message
新手上路

Joined: 2013-03-07 12:25
Posts: 29
Post 怎么判断一个网元位于屏幕之外?(即需要拖拉滚动条才可见)
如题


2014-04-23 21:57
Profile
TWaver开发组
User avatar

Joined: 2009-04-20 18:37
Posts: 3115
Post Re: 怎么判断一个网元位于屏幕之外?(即需要拖拉滚动条才可见)
Rect uiRect = network.GetElementUI(element).UnionRect;
Rect viewPortRect = new Rect(network.ScrollViewer.HorizontalOffset, network.ScrollViewer.VerticalOffset, network.ScrollViewer.ViewportWidth, network.ScrollViewer.ViewportHeight);
viewPortRect = new Rect(viewPortRect.X / network.Zoom, viewPortRect.Y / network.Zoom, viewPortRect.Width / network.Zoom, viewPortRect.Height / network.Zoom);
if (!viewPortRect.IntersectsWith(ui.UnionRect)) {
// xxx
}


2014-04-25 9:19
Profile
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron