Questions tagged [hittest]

Hit-testing (hit detection, picking, or pick correlation) is the process of determining whether a given object intersects another given object shape, line, or curve drawn on the screen.

Hit-testing (hit detection, picking, or pick correlation) is the process of determining whether a given object intersects another given object shape, line, or curve drawn on the screen.

Most commonly, hit-testing is used by GUI environments to respond to user actions. In addition, hit-testing is used in small-scale games, which do not require much computing power, and are thus able to perform all of their collision detection tests in one frame of the game loop.

In Web programming languages such as SVG and CSS, this is associated with the concept of pointer-events (e.g. user-initiated cursor movement or object selection).

543 questions
3
votes
2 answers

make VisualTreeHelper.HitTest work in a unit test?

I would like to use the WPF HitTest ability on some shapes without showing them onscreen. Is this possible? This code doesn't work the way I expected it to. How do I make this work? [Test, Ignore, RequiresSTA] public void VerifyFillContains() { …
Brannon
  • 5,324
  • 4
  • 35
  • 83
3
votes
1 answer

Some buttons fail hitTest

My interface sometimes has buttons around its periphery. Areas without buttons accept gestures. GestureRecognizers are added to the container view, in viewDidLoad. Here’s how the tapGR is set up: UITapGestureRecognizer *tapGR =…
Wienke
  • 3,723
  • 27
  • 40
3
votes
2 answers

CALayer hitTest with sublayers

I have a structure composed on a root layer and 2 CALayer subclass. These 2 layers contain a layer too. Here a scheme: ROOT LAYER | |------- LAYER A | |---------BG | | |--------LAYER B …
MatterGoal
  • 16,038
  • 19
  • 109
  • 186
3
votes
1 answer

Get HitTestResult for arbitrary point

I'd like to be able to figure out what object is at an arbitrary (x,y) point in a WebView, preferably without causing anything to change on the page. I'm developing an accessibility app for Android where the target of a link needs to be identified…
nneonneo
  • 171,345
  • 36
  • 312
  • 383
3
votes
2 answers

send touch event to UIviewController stacked in the back

In my app I have 2 transparent UIViewController layers. the first layer contain UIView object that i am trying to recognize by touch with: - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event; method. the problem is, there is an…
orthehelper
  • 4,009
  • 10
  • 40
  • 67
3
votes
1 answer

Building an MKPolygon using outer boundary of a set of coordinates - How do I split coordinates that fall on either side of a line?

I'm trying to build a MKPolygon using the outer boundary of a set of coordinates. From what I can tell, there is no delivered functionality to achieve this in Xcode (the MKPolygon methods would use all points to build the polygon, including…
3
votes
1 answer

weird ios touch event passing with UIGestureRecognizer

hi i am observing something weird in iOS custom views, where i have a button in side a custom view, i am looking for documentation or your answer to explain why i have this observation i have a custom view (subclass of UIView), it contains a simple…
user1233587
  • 2,033
  • 4
  • 24
  • 24
3
votes
1 answer

UIView hitTest blocks click in child views

I have the following structure of the views UIView(1) |--> UIScrollView |-----------> UIView(2) |------> UIButton hitTest in UIView(1) has been overridden with the following: - (UIView *)hitTest:(CGPoint) point…
UrK
  • 2,191
  • 2
  • 26
  • 42
2
votes
1 answer

check if scroll bar is clicked with doubleclick in datagrid

I need my app to perform a certain action when DataGrid is double clicked. The action should not be performed if a scrollbar is doubleclicked. So I try to see what is doubleclicked: private void DataGrid_MouseDoubleClick(object sender,…
Bogdan Verbenets
  • 25,686
  • 13
  • 66
  • 119
2
votes
1 answer

HitTest Result Callback doesn't get called

Hi I have the following code, the filter call back gets called but the result call back doesn't, I've been looking at this for some time, any help would be appreciated. public HitTestFilterBehavior MyHitTestFilter(DependencyObject o) { …
mihajlv
  • 2,275
  • 4
  • 36
  • 59
2
votes
1 answer

Visibility change of Shapes in a WPF Canvas

Is there any event that can be raised when a shape in a Canvas(which has zoom and pan controls using Translatetransform/ScaleTransform) becomes visible/invisible when the canvas is panned or zoomed? Any leads on ways to do this will be helpful and…
Sam
  • 933
  • 5
  • 14
  • 26
2
votes
1 answer

Unable to implement onTouchEvent (Drag & Drop) with Osmdroid

I had been trying to implement OnTouchEvent so I can react when an user move (drag & drop) an overlayitem. I found something similar on the Osmdroid site: http://code.google.com/p/osmdroid/issues/detail?id=225. I am using the code there as…
fulupr
  • 129
  • 2
  • 11
2
votes
3 answers

AS3 Stop character from moving through walls

I want to stop the movieclips movement when it hits a wall (another movieclip). The example below works, but after the collision the movieclip 'blocks' all movement to the left... My question to you is, is this a good way and why isn't it working…
Opoe
  • 1,337
  • 8
  • 30
  • 56
2
votes
0 answers

Finding the irregularly-shaped subview that contains a point

My main view has several (perhaps many) polygonal active areas implemented as subviews. When the user touches the view, I want to identify if she hit one of those active areas. Is there anything better than a naive algorithm that would iterate over…
Jean-Denis Muys
  • 6,772
  • 7
  • 45
  • 71
2
votes
1 answer

Make hit test visible property different for grid rows

I have a grid that contains 3 rows, one of which contains a TextBox thats can be edited. The grid sits inside a paretn that provides drag functionality to enable it to moved around a canvas. In order to enable this, i need to set IsHitTestVisible to…
richzilla
  • 40,440
  • 14
  • 56
  • 86