code review updates: sprite_atlas brackets and nullable removed for reuseIdentifier of annotationImage
This commit is contained in:
committed by
Minh Nguyễn
parent
af45d87e54
commit
b8be1f0632
@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @param image The image to be displayed for the annotation.
|
||||
* @param reuseIdentifier The string that identifies that this annotation image is reusable.
|
||||
* @return The initialized annotation image object or `nil` if there was a problem initializing the object. */
|
||||
+ (instancetype)annotationImageWithImage:(UIImage *)image reuseIdentifier:(nullable NSString *)reuseIdentifier;
|
||||
+ (instancetype)annotationImageWithImage:(UIImage *)image reuseIdentifier:(NSString *)reuseIdentifier;
|
||||
|
||||
/** @name Getting and Setting Attributes */
|
||||
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
@implementation MGLAnnotationImage
|
||||
|
||||
+ (instancetype)annotationImageWithImage:(UIImage *)image reuseIdentifier:(nullable NSString *)reuseIdentifier
|
||||
+ (instancetype)annotationImageWithImage:(UIImage *)image reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
return [[self alloc] initWithImage:image reuseIdentifier:reuseIdentifier];
|
||||
}
|
||||
|
||||
- (instancetype)initWithImage:(UIImage *)image reuseIdentifier:(nullable NSString *)reuseIdentifier
|
||||
- (instancetype)initWithImage:(UIImage *)image reuseIdentifier:(NSString *)reuseIdentifier
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
|
||||
@@ -187,12 +187,9 @@ void SpriteAtlas::updateDirty() {
|
||||
// The two names match;
|
||||
Holder& holder = imageIterator->second;
|
||||
holder.texture = spriteIterator->second;
|
||||
if (holder.texture != nullptr)
|
||||
{
|
||||
if (holder.texture != nullptr) {
|
||||
copy(holder, imageIterator->first.second);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
images.erase(imageIterator);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user