File tree 5 files changed +22
-6
lines changed
5 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,6 @@ - (id)initFromXMLElement:(DDXMLElement *)element
103
103
}
104
104
_signals = [NSArray arrayWithArray: tmpElements];
105
105
106
- // / ...
107
-
108
106
109
107
// Plain
110
108
elements = [element nodesForXPath: @" plain/*" error: &error];
Original file line number Diff line number Diff line change 23
23
@property (readonly ) NSString *valueText; // Same as value
24
24
25
25
- (void )drawInContext : (CGContextRef )context layerNumber : (NSNumber *)layerNumber ;
26
+ - (BOOL )isOnBottomLayer ;
27
+ - (BOOL )isOnTopLayer ;
26
28
27
29
@end
Original file line number Diff line number Diff line change @@ -102,6 +102,17 @@ - (NSString *)description
102
102
return [NSString stringWithFormat: @" Element %@ - value: %@ " , _name, _value];
103
103
}
104
104
105
+ - (BOOL )isOnBottomLayer
106
+ {
107
+ // A mirrored object is considered a bottom element.
108
+ return [EAGLEDrawableObject rotationIsMirrored: _rotation];
109
+ }
110
+
111
+ - (BOOL )isOnTopLayer
112
+ {
113
+ return ![self isOnBottomLayer ];
114
+ }
115
+
105
116
- (void )drawInContext : (CGContextRef )context layerNumber : (NSNumber *)layerNumber
106
117
{
107
118
// Rotate if necessary. First offset coordinate system to origin point then rotate. State is pushed/popped.
Original file line number Diff line number Diff line change @@ -346,10 +346,14 @@ - (NSArray*)objectsAtPoint:(CGPoint)point
346
346
EAGLEBoard *board = (EAGLEBoard*)self.file ;
347
347
348
348
// Instances
349
- for ( id <EAGLEDrawable> drawable in board.elements )
349
+ for ( EAGLEElement *element in board.elements )
350
350
{
351
- if ( CGRectContainsPoint ( [drawable boundingRect ], coordinate ))
352
- objectsAtCoordinate[ distance ( drawable, coordinate ) ] = drawable;
351
+ // Ignore this element if it is on the top layer and layer 1 (top) is hidden or it is on bottom and the bottom layer (16) is hidden
352
+ if ( ([element isOnTopLayer ] && !((EAGLELayer*)self.file .layers [ @1 ]).visible ) || ([element isOnBottomLayer ] && !((EAGLELayer*)self.file .layers [ @16 ]).visible ) )
353
+ continue ;
354
+
355
+ if ( CGRectContainsPoint ( [element boundingRect ], coordinate ))
356
+ objectsAtCoordinate[ distance ( element, coordinate ) ] = element;
353
357
}
354
358
355
359
/*
Original file line number Diff line number Diff line change 18
18
- Improve single vs. double tap on iPhone
19
19
- Alternative to polygon fills: polygons on/off setting
20
20
- Speed up drawing by checking for relevant rect?
21
- - Hit-test: ignore components on top/bottom if relevant layer not shown
22
21
- Search: deselect all marked components
23
22
- Fix text drawing of R270 rotated instances
24
23
- Fix bounding rect of R270 rotated instances
@@ -40,6 +39,8 @@ In progress/partly done:
40
39
-----
41
40
Done:
42
41
42
+ √ Hit-test: ignore components on top/bottom if relevant layer not shown
43
+ √ Fixed initial state of toolbar buttons
43
44
√ Fixed initial file loading
44
45
--- b142
45
46
√ Disable sheets picker if there is only one sheet/module or if it's a board file
You can’t perform that action at this time.
0 commit comments