Skip to content

Commit

Permalink
fix: block selection size overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed Jun 5, 2023
1 parent 90bed43 commit 86f5628
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class ImageBlockComponentBuilder extends BlockComponentBuilder {
BlockComponentWidget build(BlockComponentContext blockComponentContext) {
final node = blockComponentContext.node;
return ImageBlockComponentWidget(
key: node.key,
node: node,
showActions: showActions(node),
configuration: configuration,
Expand Down Expand Up @@ -104,7 +105,6 @@ class _ImageBlockComponentWidgetState extends State<ImageBlockComponentWidget> {
final width = attributes[ImageBlockKeys.width]?.toDouble();

Widget child = ImageNodeWidget(
key: node.key,
node: node,
src: src,
width: width,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,14 @@ class _DesktopSelectionServiceWidgetState
currentSelectedNodes = nodes;

final node = nodes.first;
var rect = Offset.zero & node.rect.size;

var offset = Offset.zero;
var size = node.rect.size;
final builder = editorState.renderer.blockComponentBuilder(node.type);
if (builder != null && builder.showActions(node)) {
rect = rect.translate(blockComponentActionContainerWidth, 0);
offset = offset.translate(blockComponentActionContainerWidth, 0);
size = Size(size.width - blockComponentActionContainerWidth, size.height);
}
final rect = offset & size;

final overlay = OverlayEntry(
builder: (context) => SelectionWidget(
Expand Down

0 comments on commit 86f5628

Please sign in to comment.