mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Add tagForLayerContainingPoint:
This is meant for subclasses which need to translate an NSPoint to a layer and cannot rely on the normal handling of this in the superclass.
This commit is contained in:
@@ -90,6 +90,7 @@ struct layer_t
|
||||
- (uint32_t)currentState;
|
||||
- (void)setLayout:(std::vector<layer_t> const&)aLayout;
|
||||
- (void)sendAction:(SEL)action fromLayer:(layer_t const&)aLayer;
|
||||
- (NSInteger)tagForLayerContainingPoint:(NSPoint)aPoint;
|
||||
@property (nonatomic, readonly) NSInteger tag; // tag of the most recent layer causing an action
|
||||
@property (nonatomic, assign) BOOL mouseTrackingDisabled;
|
||||
@end
|
||||
|
||||
@@ -126,6 +126,17 @@ OAK_DEBUG_VAR(OakControl);
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSInteger)tagForLayerContainingPoint:(NSPoint)aPoint
|
||||
{
|
||||
NSInteger res = NSNotFound;
|
||||
iterate(it, layout)
|
||||
{
|
||||
if(NSMouseInRect(aPoint, it->rect, [self isFlipped]))
|
||||
res = it->tag;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent*)event
|
||||
{
|
||||
// This code is copy/paste from mouseDown: and should ideally be de-duplicated.
|
||||
|
||||
Reference in New Issue
Block a user