feat:修改图片路径

This commit is contained in:
R524809
2025-12-22 11:25:22 +08:00
parent c7d55e1e2d
commit e23da39bdf
60 changed files with 7 additions and 7 deletions

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

@@ -150,7 +150,7 @@ class AdditionDraw extends BaseDrawService {
// 加载图片 // 加载图片
let image: any = null; let image: any = null;
try { try {
const imagePath = `/mathPages/assets/${config.folder}/${imageConfigItem.imageIndex}.png`; const imagePath = `/mathPages/shared/assets/${config.folder}/${imageConfigItem.imageIndex}.png`;
image = await getImage(canvas, imagePath); image = await getImage(canvas, imagePath);
} catch (error) { } catch (error) {
console.error('图片加载失败:', error); console.error('图片加载失败:', error);
@@ -303,7 +303,7 @@ class CompareDraw extends BaseDrawService {
// 加载图片 // 加载图片
let boxImage: any = null; let boxImage: any = null;
try { try {
const imagePath = `/mathPages/assets/${folder}/${imageIndex}.png`; const imagePath = `/mathPages/shared/assets/${folder}/${imageIndex}.png`;
boxImage = await getImage(canvas, imagePath); boxImage = await getImage(canvas, imagePath);
} catch (error) { } catch (error) {
console.error(`加载${folder}/${imageIndex}图片失败:`, error); console.error(`加载${folder}/${imageIndex}图片失败:`, error);
@@ -207,7 +207,7 @@ class CountMatchDraw extends BaseDrawService {
// 加载当前框使用的图片(只加载一次,用于计算高度和绘制) // 加载当前框使用的图片(只加载一次,用于计算高度和绘制)
let boxImage: any = null; let boxImage: any = null;
try { try {
const imagePath = `/mathPages/assets/${config.folder}/${boxImageIndex}.png`; const imagePath = `/mathPages/shared/assets/${config.folder}/${boxImageIndex}.png`;
boxImage = await getImage(canvas, imagePath); boxImage = await getImage(canvas, imagePath);
} catch (error) { } catch (error) {
console.error( console.error(
@@ -304,7 +304,7 @@ class CountingSelectDraw extends BaseDrawService {
// 加载图片 // 加载图片
let boxImage: any = null; let boxImage: any = null;
try { try {
const imagePath = `/mathPages/assets/${config.folder}/${imageIndex}.png`; const imagePath = `/mathPages/shared/assets/${config.folder}/${imageIndex}.png`;
boxImage = await getImage(canvas, imagePath); boxImage = await getImage(canvas, imagePath);
} catch (error) { } catch (error) {
console.error(`加载${config.folder}/${imageIndex}图片失败:`, error); console.error(`加载${config.folder}/${imageIndex}图片失败:`, error);
@@ -487,7 +487,7 @@ class NumberDecomposeDraw extends BaseDrawService {
// 加载图片 // 加载图片
let boxImage: any = null; let boxImage: any = null;
try { try {
const imagePath = `/mathPages/assets/${config.folder}/${imageIndex}.png`; const imagePath = `/mathPages/shared/assets/${config.folder}/${imageIndex}.png`;
boxImage = await getImage(canvas, imagePath); boxImage = await getImage(canvas, imagePath);
} catch (error) { } catch (error) {
console.error(`加载${config.folder}/${imageIndex}图片失败:`, error); console.error(`加载${config.folder}/${imageIndex}图片失败:`, error);
@@ -52,7 +52,7 @@ export async function drawNumberPreview({
// 加载并绘制 animal-number 图片 // 加载并绘制 animal-number 图片
try { try {
const animalImagePath = `/mathPages/assets/animal-number/animal-number-${selectedNumber}.png`; const animalImagePath = `/mathPages/shared/assets/animal-number/animal-number-${selectedNumber}.png`;
const animalImage = await getImage(canvas, animalImagePath); const animalImage = await getImage(canvas, animalImagePath);
ctx.drawImage( ctx.drawImage(
animalImage, animalImage,
@@ -79,7 +79,7 @@ export async function drawNumberPreview({
ctx.strokeRect(boxX, fingerBoxY, boxWidth, boxHeight); ctx.strokeRect(boxX, fingerBoxY, boxWidth, boxHeight);
try { try {
const fingerImagePath = `/mathPages/assets/finger/finger-${selectedNumber}.png`; const fingerImagePath = `/mathPages/shared/assets/finger/finger-${selectedNumber}.png`;
const fingerImage = await getImage(canvas, fingerImagePath); const fingerImage = await getImage(canvas, fingerImagePath);
// 计算图片在框内的位置(居中显示) // 计算图片在框内的位置(居中显示)
const imagePadding = 10; const imagePadding = 10;