Commit 1dd7d7fe authored by Sidney San Martín's avatar Sidney San Martín Committed by Commit Bot

Revert an incorrect workaround for a crash.

This reverts commit 80e335a5.

Bug: 826632
Change-Id: I159ce3037f96af582b6095dca69d4d1cd4318843
Reviewed-on: https://chromium-review.googlesource.com/1014363
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Reviewed-by: default avatarLeonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551320}
parent c295dd83
...@@ -654,12 +654,6 @@ NSTextField* MakeLabel( ...@@ -654,12 +654,6 @@ NSTextField* MakeLabel(
draggingItem.draggingFrame = dragRect; draggingItem.draggingFrame = dragRect;
draggingItem.imageComponentsProvider = ^{ draggingItem.imageComponentsProvider = ^{
// If either component is zero sized (which shouldn't generally happen, but
// apparently can… maybe a missing icon or empty string title?), omit it,
// else the dragging session will create layers with NaN components and
// crash.
auto* components = [NSMutableArray<NSDraggingImageComponent*> array];
if (imageRect.size.width != 0 && imageRect.size.height != 0) {
NSDraggingImageComponent* imageComponent = NSDraggingImageComponent* imageComponent =
[[[NSDraggingImageComponent alloc] [[[NSDraggingImageComponent alloc]
initWithKey:NSDraggingImageComponentIconKey] autorelease]; initWithKey:NSDraggingImageComponentIconKey] autorelease];
...@@ -667,9 +661,6 @@ NSTextField* MakeLabel( ...@@ -667,9 +661,6 @@ NSTextField* MakeLabel(
imageComponent.contents = image; imageComponent.contents = image;
imageComponent.frame = imageComponent.frame =
NSOffsetRect(imageRect, -dragRect.origin.x, -dragRect.origin.y); NSOffsetRect(imageRect, -dragRect.origin.x, -dragRect.origin.y);
[components addObject:imageComponent];
}
if (labelRect.size.width != 0 && labelRect.size.height != 0) {
NSDraggingImageComponent* labelComponent = NSDraggingImageComponent* labelComponent =
[[[NSDraggingImageComponent alloc] [[[NSDraggingImageComponent alloc]
initWithKey:NSDraggingImageComponentLabelKey] autorelease]; initWithKey:NSDraggingImageComponentLabelKey] autorelease];
...@@ -682,10 +673,7 @@ NSTextField* MakeLabel( ...@@ -682,10 +673,7 @@ NSTextField* MakeLabel(
}]; }];
labelComponent.frame = labelComponent.frame =
NSOffsetRect(labelRect, -dragRect.origin.x, -dragRect.origin.y); NSOffsetRect(labelRect, -dragRect.origin.x, -dragRect.origin.y);
[components addObject:labelComponent]; return @[ imageComponent, labelComponent ];
}
return components;
}; };
[self beginDraggingSessionWithItems:@[ draggingItem ] [self beginDraggingSessionWithItems:@[ draggingItem ]
event:event event:event
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment