Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #502: Finding the tap location inside a group #507

Merged
merged 4 commits into from
Nov 14, 2018

Conversation

f3dm76
Copy link
Collaborator

@f3dm76 f3dm76 commented Nov 9, 2018

No description provided.

public struct TouchPoint {
public let id: Int
public let location: Point
@available(*, deprecated) public let location: Point // absolute location
private let absoluteLocation: Point
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid this variable in favor of location or make location computable to avoid storing unnecessary variable.

@@ -51,14 +51,14 @@ class GroupRenderer: NodeRenderer {
return nil
}

override func doFindAllNodesAt(location: CGPoint, ctx: CGContext) -> [Node]? {
override func doFindAllNodesAt(location: CGPoint, ctx: CGContext) -> [NodeTouch]? {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's too complicated. Let's use following class:

class NodePath {
  let node: Node
  let location: CGPoint
  let parent: NodePath?
}

Also do we still need doFindNodeAt method? Can we have only one method to find node by location?

@ystrot ystrot self-assigned this Nov 14, 2018
@ystrot ystrot added this to the 0.9.4 milestone Nov 14, 2018
@ystrot ystrot merged commit 428eb67 into exyte:master Nov 14, 2018
@f3dm76 f3dm76 deleted the task/relativeLocation branch February 6, 2019 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants