Skip to content

Commit 1a7af06

Browse files
committed
🚧 Fixed Texture Stretching in Variant Texture Map
- Added a checkerboard pattern to the background of textures to indicate transparency better.
1 parent 63ce4b5 commit 1a7af06

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

src/components/variantConfigDialog.svelte

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
}
9696
</script>
9797

98-
<div class="dialog_container">
98+
<div class="dialog-container">
9999
<LineInput
100100
label={translate('dialog.variant_config.variant_display_name')}
101101
bind:value={displayName}
@@ -154,15 +154,17 @@
154154
}}
155155
/>
156156
</div>
157-
<lu class="texture_map_container">
157+
<lu class="texture-map-container">
158158
{#key textureMapUpdated}
159159
{#each [...textureMap.map.entries()] as entry, index}
160-
<div class="texture_mapping_item"></div>
161-
<li class="texture_mapping_item">
162-
<div class="texture_mapping_item_dropdown_container">
163-
<img src={getTextureSrc(entry[0])} alt="" />
160+
<div class="texture-mapping-item"></div>
161+
<li class="texture-mapping-item">
162+
<div class="texture-mapping-item-dropdown-container">
163+
<div class="img-container">
164+
<img src={getTextureSrc(entry[0])} alt="" />
165+
</div>
164166
<select
165-
class="texture_mapping_item_dropdown"
167+
class="texture-mapping-item-dropdown"
166168
on:change={e => selectNewPrimaryTexture(e, entry[0])}
167169
>
168170
<!-- svelte-ignore missing-declaration -->
@@ -176,10 +178,12 @@
176178

177179
<i class="material-icons icon">east</i>
178180

179-
<div class="texture_mapping_item_dropdown_container">
180-
<img src={getTextureSrc(entry[1])} alt="" />
181+
<div class="texture-mapping-item-dropdown-container">
182+
<div class="img-container">
183+
<img src={getTextureSrc(entry[1])} alt="" />
184+
</div>
181185
<select
182-
class="texture_mapping_item_dropdown"
186+
class="texture-mapping-item-dropdown"
183187
on:change={e => selectNewSecondaryTexture(e, entry[0])}
184188
>
185189
<!-- svelte-ignore missing-declaration -->
@@ -198,8 +202,8 @@
198202
>
199203
</li>
200204
{:else}
201-
<div class="no_mappings">
202-
{translate('dialog.variant_config.texture_map.no_mappings')}
205+
<div class="no-mappings">
206+
{translate('dialog.variant_config.texture_map.no-mappings')}
203207
</div>
204208
{/each}
205209
{/key}
@@ -225,7 +229,7 @@
225229
</div>
226230

227231
<style>
228-
.dialog_container {
232+
.dialog-container {
229233
display: flex;
230234
flex-direction: column;
231235
}
@@ -236,22 +240,30 @@
236240
font-size: 14px;
237241
user-select: all;
238242
}
239-
.no_mappings {
243+
.no-mappings {
240244
color: var(--color-subtle_text);
241245
font-style: italic;
242246
text-align: center;
243247
}
244-
img {
248+
.img-container {
249+
display: flex;
250+
align-items: flex-start;
245251
width: 128px;
246252
height: 128px;
247253
pointer-events: none;
254+
background: repeating-conic-gradient(var(--color-dark) 0% 25%, transparent 0% 50%) 50% /
255+
16px 16px;
256+
}
257+
img {
258+
width: 128px;
259+
pointer-events: none;
248260
}
249-
.texture_mapping_item {
261+
.texture-mapping-item {
250262
display: flex;
251263
align-items: center;
252264
justify-content: space-between;
253265
}
254-
.texture_mapping_item_dropdown_container {
266+
.texture-mapping-item-dropdown-container {
255267
position: relative;
256268
flex-grow: 1;
257269
height: 164px;
@@ -260,13 +272,13 @@
260272
align-items: center;
261273
justify-content: center;
262274
}
263-
.texture_mapping_item_dropdown {
275+
.texture-mapping-item-dropdown {
264276
display: flex;
265277
flex-direction: column;
266278
align-items: center;
267279
max-width: 128px;
268280
}
269-
.texture_map_container {
281+
.texture-map-container {
270282
display: flex;
271283
flex-direction: column;
272284
border: 1px solid var(--color-border);

0 commit comments

Comments
 (0)