Skip to content

Commit

Permalink
Fix object images not displaying on quick customization
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementPasteau committed Sep 12, 2024
1 parent ef604fd commit 8fbd847
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion newIDE/app/src/QuickCustomization/ObjectPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type Props = {|
object: gdObject,
|};

const paddingSize = 10;
const styles = {
previewContainer: {
display: 'flex',
Expand Down Expand Up @@ -41,6 +42,12 @@ const styles = {
...textEllipsisStyle,
overflowWrap: 'break-word',
},
previewImage: {
position: 'relative',
objectFit: 'contain',
verticalAlign: 'middle',
pointerEvents: 'none',
},
};

export const ObjectPreview = ({ project, object }: Props) => {
Expand All @@ -65,7 +72,11 @@ export const ObjectPreview = ({ project, object }: Props) => {
project,
object.getConfiguration()
)}
style={{ maxWidth: 120, maxHeight: 120 }}
style={{
...styles.previewImage,
maxWidth: 128 - 2 * paddingSize,
maxHeight: 128 - 2 * paddingSize,
}}
/>
)}
</div>
Expand Down

0 comments on commit 8fbd847

Please sign in to comment.