ginipick commited on
Commit
43cd897
ยท
verified ยท
1 Parent(s): afa06a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -5
app.py CHANGED
@@ -340,6 +340,13 @@ HTML_TEMPLATE = '''
340
  display: flex;
341
  align-items: center;
342
  justify-content: center;
 
 
 
 
 
 
 
343
  }
344
 
345
  .speech-bubble-tail {
@@ -378,6 +385,13 @@ HTML_TEMPLATE = '''
378
  display: flex;
379
  align-items: center;
380
  justify-content: center;
 
 
 
 
 
 
 
381
  }
382
 
383
  .thought-bubble-dots {
@@ -537,11 +551,11 @@ HTML_TEMPLATE = '''
537
  color: black;
538
  text-align: center;
539
  padding: 5px;
540
- overflow: hidden;
541
  line-height: 1.5;
542
- display: flex;
543
- align-items: center;
544
- justify-content: center;
545
  }
546
 
547
  /* ๋กœ๋”ฉ ์ธ๋””์ผ€์ดํ„ฐ */
@@ -1283,11 +1297,25 @@ HTML_TEMPLATE = '''
1283
  tempContainer.style.left = '-9999px';
1284
  document.body.appendChild(tempContainer);
1285
 
 
1286
  html2canvas(tempContainer, {
1287
  backgroundColor: '#ffffff',
1288
  scale: 2,
1289
  useCORS: true,
1290
- logging: false
 
 
 
 
 
 
 
 
 
 
 
 
 
1291
  }).then(function(canvas) {
1292
  const link = document.createElement('a');
1293
  link.download = 'webtoon_' + imageNumber + '_' + new Date().getTime() + '.png';
 
340
  display: flex;
341
  align-items: center;
342
  justify-content: center;
343
+ box-sizing: border-box;
344
+ }
345
+
346
+ .speech-bubble .component-text {
347
+ margin-top: 0;
348
+ padding-top: 8px;
349
+ padding-bottom: 8px;
350
  }
351
 
352
  .speech-bubble-tail {
 
385
  display: flex;
386
  align-items: center;
387
  justify-content: center;
388
+ box-sizing: border-box;
389
+ }
390
+
391
+ .thought-bubble .component-text {
392
+ margin-top: 0;
393
+ padding-top: 8px;
394
+ padding-bottom: 8px;
395
  }
396
 
397
  .thought-bubble-dots {
 
551
  color: black;
552
  text-align: center;
553
  padding: 5px;
554
+ overflow: visible;
555
  line-height: 1.5;
556
+ vertical-align: middle;
557
+ white-space: pre-wrap;
558
+ word-break: break-word;
559
  }
560
 
561
  /* ๋กœ๋”ฉ ์ธ๋””์ผ€์ดํ„ฐ */
 
1297
  tempContainer.style.left = '-9999px';
1298
  document.body.appendChild(tempContainer);
1299
 
1300
+ // html2canvas ์˜ต์…˜ ์ˆ˜์ •
1301
  html2canvas(tempContainer, {
1302
  backgroundColor: '#ffffff',
1303
  scale: 2,
1304
  useCORS: true,
1305
+ logging: false,
1306
+ scrollY: 0,
1307
+ scrollX: 0,
1308
+ windowHeight: tempContainer.scrollHeight,
1309
+ windowWidth: tempContainer.scrollWidth,
1310
+ onclone: function(clonedDoc) {
1311
+ // ํด๋ก ๋œ ๋ฌธ์„œ์—์„œ ํ…์ŠคํŠธ ์˜์—ญ ์Šคํƒ€์ผ ์กฐ์ •
1312
+ const textAreas = clonedDoc.querySelectorAll('.component-text');
1313
+ textAreas.forEach(textarea => {
1314
+ textarea.style.paddingTop = '10px';
1315
+ textarea.style.lineHeight = '1.6';
1316
+ textarea.style.overflow = 'visible';
1317
+ });
1318
+ }
1319
  }).then(function(canvas) {
1320
  const link = document.createElement('a');
1321
  link.download = 'webtoon_' + imageNumber + '_' + new Date().getTime() + '.png';