Hi there, I have a similar Problem with a Glyphs3 plugin port.
I used to use the alignComponents
method on a layer before, in order to live update the recyclers when an Anchor is moved.
This method doesn’t exist in Glyphs 3 anymore. Hence I made a category on GSLayer to keep my legacy code as is. unfortunately, none of the attempts to force alignment on the layer doesn’t do anything. Here’s my category method with all the things I tried:
- (void)alignComponents {
for (id shape in self.shapes) {
if ([shape isKindOfClass:GSComponent.class]) {
GSComponent *c = shape;
// [c setAlignment:YES];
[c setAlignment:GSAlignmentAligned]; // or `GSAlignmentForce` ?
// [c makeForceAlignment];
[c setIsAligned:GSAlignmentAligned]; // or `GSAlignmentForce` ?
[c.componentLayer setIsAligning:YES];
//[c.componentLayer setNeedUpdateShapes];
}
}
}
Note: the layer I called the alignComponents
on is a copy of course.
GSLayer *componentLayer = [layer copy];
[componentLayer setParent: layer.parent];
[componentLayer alignComponents];
This used to work fine in Glyphs 2.
Edit:
This actually fixed it, but seems to be more of a hack than a proper solution:
The compiler doesn’t complain anymore about the missing method, and the behaviour is back as expected. However, the compiler should not complain, the alignComponents
method is documented in the Glyphs3 docu core
@interface GSLayer (LegacyMethods)
- (void) alignComponents;
@end