GiantPandas commited on
Commit
c1d0d10
·
verified ·
1 Parent(s): ed5f075

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -13
app.py CHANGED
@@ -308,21 +308,26 @@ def render_img(b64_list, idx, scale):
308
  # f'</div>'
309
  # )
310
 
311
- return f'''
312
  <div style="
313
- overflow:auto;border:1px solid #ccc;
314
- display:flex;
315
- justify-content:center;
316
- align-items:center; /* 垂直也居中 */
317
- width:100%;height:800px;">
318
- <img src="{src}"
319
- style="
320
- width:{percent}%;
321
- max-width:none;
322
- height:auto;
323
- flex-shrink:0;" />
 
 
 
 
 
324
  </div>
325
- '''
326
  else:
327
  # ---------- 放大模式 ----------
328
  return (
 
308
  # f'</div>'
309
  # )
310
 
311
+ return f"""
312
  <div style="
313
+ width:100%;
314
+ height:800px;
315
+ overflow:auto;
316
+ border:1px solid #ccc;
317
+ ">
318
+ <div style="
319
+ min-width:100%; /* 保证外层 div 至少跟容器一样宽 */
320
+ display:flex;
321
+ justify-content:center; /* 小图水平居中 */
322
+ ">
323
+ <img src="{src}" style="
324
+ width:{percent}%;
325
+ height:auto;
326
+ display:block;
327
+ ">
328
+ </div>
329
  </div>
330
+ """
331
  else:
332
  # ---------- 放大模式 ----------
333
  return (