Skip to content

Commit

Permalink
allow double click on the whole purple area, like the click
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Sep 10, 2024
1 parent 32b75eb commit 6a322d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/editor/components/scenegraph/Entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,20 @@ export default class Entity extends React.Component {
});

return (
<div className={className} onClick={this.onClick} id={this.props.id}>
<div
className={className}
onClick={this.onClick}
onDoubleClick={this.onDoubleClick}
id={this.props.id}
>
<span>
<span
style={{
width: `${30 * (this.props.depth - 1)}px`
}}
/>
{visibilityButton}
{printEntity(entity, this.onDoubleClick)}
{printEntity(entity)}
{collapse}
</span>
<span className="entityActions">
Expand Down
4 changes: 2 additions & 2 deletions src/editor/lib/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ const ICONS = {
light: 'fa-lightbulb-o',
text: 'fa-font'
};
export function printEntity(entity, onDoubleClick) {
export function printEntity(entity) {
if (!entity) {
return '';
}
Expand All @@ -589,7 +589,7 @@ export function printEntity(entity, onDoubleClick) {
// Custom display name for a layer if available, otherwise use entity name or tag
let displayName = getEntityDisplayName(entity);
return (
<span className="entityPrint" onDoubleClick={onDoubleClick}>
<span className="entityPrint">
{displayName && <span className="entityName">&nbsp;{displayName}</span>}
{!!icons && (
<span
Expand Down

0 comments on commit 6a322d8

Please sign in to comment.