|
12 | 12 | .designer { background: #fff; flex: 1; position: relative; padding: 20px; border-radius: 8px; box-shadow: 1px 1px 4px #ddd; } |
13 | 13 | .designer-area { position: relative; width: 500px; height: 320px; background: #eee; border: 2px dashed #bbb; border-radius: 8px; overflow: hidden; margin: 0 auto; } |
14 | 14 | .designer-area.has-bg { width: auto; height: auto; min-height: 320px} |
15 | | - .bg-image-input { margin-bottom: 14px; |
| 15 | + .bg-image-input { margin-bottom: 14px; } |
16 | 16 | #designerBg {position: absolute;top:0;left:0;width:100%;height:100%;z-index:0;object-fit:cover;} |
17 | 17 | .field { position:absolute; min-width: 48px; min-height: 21px; background: transparent; border:1px solid #888; border-radius:4px; padding:0px; cursor:move; -webkit-user-select: none; user-select: none; box-sizing:border-box; overflow:visible; text-align:center; display:flex; align-items:center; justify-content:center;} |
18 | 18 | .field-resize-handle { position:absolute; width:10px; height:10px; right:0; bottom:0; cursor:se-resize; background:rgba(0,0,0,0.3);} |
@@ -640,47 +640,45 @@ <h2>QSL Card Designer (QSLカードデザイナー)</h2> |
640 | 640 | } |
641 | 641 |
|
642 | 642 | // フィールドを描画 |
643 | | - if (adifRecords.length > 0) { |
644 | | - const rec = adifRecords[qsoIdx] || {}; |
645 | | - designerFields.forEach((f) => { |
646 | | - const v = (rec[f.name] !== undefined ? rec[f.name] : ""); |
647 | | - const w = f.width || 160; |
648 | | - const h = f.height || 16; |
649 | | - const x = f.x || 0; |
650 | | - const y = f.y || 0; |
651 | | - |
652 | | - // フィールドの背景(透明なのでスキップ) |
653 | | - // テキストを描画 |
654 | | - const fontSize = h * 1.0; |
655 | | - |
656 | | - // フォント設定(無線局コールサインと相手局の場合のみカスタムフォント) |
657 | | - let fontFamily = 'Arial, Meiryo, sans-serif'; |
658 | | - if ((f.name === 'STATION_CALLSIGN' || f.name === 'CALL') && f.fontFamily) { |
659 | | - fontFamily = f.fontFamily; |
660 | | - } |
661 | | - ctx.font = `bold ${fontSize}px ${fontFamily}`; |
662 | | - ctx.textAlign = 'center'; |
663 | | - ctx.textBaseline = 'middle'; |
664 | | - |
665 | | - // テキスト内容 |
666 | | - let text = ''; |
667 | | - if (f.showName !== false) { |
668 | | - text = `${f.displayName}: ${v}`; |
669 | | - } else { |
670 | | - text = v; |
671 | | - } |
672 | | - |
673 | | - // 色設定(無線局コールサインと相手局の場合のみカスタムカラー) |
674 | | - let textColor = '#000000'; |
675 | | - if ((f.name === 'STATION_CALLSIGN' || f.name === 'CALL') && f.color) { |
676 | | - textColor = f.color; |
677 | | - } |
678 | | - |
679 | | - // テキストを描画 |
680 | | - ctx.fillStyle = textColor; |
681 | | - ctx.fillText(text, x + w / 2, y + h / 2); |
682 | | - }); |
683 | | - } |
| 643 | + const rec = adifRecords[qsoIdx] || {}; |
| 644 | + designerFields.forEach((f) => { |
| 645 | + const v = (rec[f.name] !== undefined ? rec[f.name] : ""); |
| 646 | + const w = f.width || 160; |
| 647 | + const h = f.height || 16; |
| 648 | + const x = f.x || 0; |
| 649 | + const y = f.y || 0; |
| 650 | + |
| 651 | + // フィールドの背景(透明なのでスキップ) |
| 652 | + // テキストを描画 |
| 653 | + const fontSize = h * 1.0; |
| 654 | + |
| 655 | + // フォント設定(無線局コールサインと相手局の場合のみカスタムフォント) |
| 656 | + let fontFamily = 'Arial, Meiryo, sans-serif'; |
| 657 | + if ((f.name === 'STATION_CALLSIGN' || f.name === 'CALL') && f.fontFamily) { |
| 658 | + fontFamily = f.fontFamily; |
| 659 | + } |
| 660 | + ctx.font = `bold ${fontSize}px ${fontFamily}`; |
| 661 | + ctx.textAlign = 'center'; |
| 662 | + ctx.textBaseline = 'middle'; |
| 663 | + |
| 664 | + // テキスト内容 |
| 665 | + let text = ''; |
| 666 | + if (f.showName !== false) { |
| 667 | + text = `${f.displayName}: ${v}`; |
| 668 | + } else { |
| 669 | + text = v; |
| 670 | + } |
| 671 | + |
| 672 | + // 色設定(無線局コールサインと相手局の場合のみカスタムカラー) |
| 673 | + let textColor = '#000000'; |
| 674 | + if ((f.name === 'STATION_CALLSIGN' || f.name === 'CALL') && f.color) { |
| 675 | + textColor = f.color; |
| 676 | + } |
| 677 | + |
| 678 | + // テキストを描画 |
| 679 | + ctx.fillStyle = textColor; |
| 680 | + ctx.fillText(text, x + w / 2, y + h / 2); |
| 681 | + }); |
684 | 682 |
|
685 | 683 | // PNGとしてダウンロード |
686 | 684 | canvas.toBlob(function(blob) { |
|
0 commit comments