@rpg-engine/long-bow 0.5.4 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -130,10 +130,12 @@ const BackgroundImage = styled.div<IBackgroundImage>`
130
130
  background-image: url(${props => props.imagePath});
131
131
  background-repeat: no-repeat;
132
132
  background-attachment: fixed;
133
- background-size: cover;
133
+ background-size: contain;
134
+ background-position: center;
134
135
  width: 100%;
135
136
  height: ${props => (props.isTextFixed ? '80%' : '100%')};
136
137
  `;
138
+
137
139
  const Description = styled.div<ITextDescription>`
138
140
  width: 100%;
139
141
  height: ${props => (props.isTextFixed ? 'auto' : '100%')};
@@ -39,7 +39,8 @@ export const SpriteFromAtlas: React.FC<IProps> = ({
39
39
  //!Due to React's limitations, we cannot import it from the public folder directly!
40
40
 
41
41
  const spriteData =
42
- atlasJSON.frames[spriteKey] || atlasJSON.frames['others/no-image.png'];
42
+ atlasJSON?.frames?.[spriteKey] ||
43
+ atlasJSON?.frames?.['others/no-image.png'];
43
44
 
44
45
  if (!spriteData) throw new Error(`Sprite ${spriteKey} not found in atlas!`);
45
46