Spaces:
Sleeping
Sleeping
Fix horizontal zoom stretching - allow width to scale properly
Browse files- Remove max-width constraint that was limiting horizontal scaling
- Add display: inline-block to container for proper sizing
- Add image-rendering: crisp-edges for sharp pixel display
- Now both width and height scale proportionally without distortion
app.py
CHANGED
|
@@ -86,15 +86,16 @@ def apply_zoom_output(zoom_level):
|
|
| 86 |
border: 1px solid #ccc;
|
| 87 |
border-radius: 4px;
|
| 88 |
overflow: auto;
|
| 89 |
-
max-width: 100%;
|
| 90 |
max-height: 600px;
|
| 91 |
padding: 10px;
|
| 92 |
background-color: #f9f9f9;
|
|
|
|
| 93 |
">
|
| 94 |
<img src="data:image/png;base64,{img_base64}" style="
|
| 95 |
width: {new_w}px;
|
| 96 |
height: {new_h}px;
|
| 97 |
display: block;
|
|
|
|
| 98 |
" />
|
| 99 |
</div>
|
| 100 |
<p style="font-size: 12px; color: #666; margin-top: 5px;">
|
|
@@ -127,15 +128,16 @@ def apply_zoom_preprocessed(zoom_level):
|
|
| 127 |
border: 1px solid #ccc;
|
| 128 |
border-radius: 4px;
|
| 129 |
overflow: auto;
|
| 130 |
-
max-width: 100%;
|
| 131 |
max-height: 600px;
|
| 132 |
padding: 10px;
|
| 133 |
background-color: #f9f9f9;
|
|
|
|
| 134 |
">
|
| 135 |
<img src="data:image/png;base64,{img_base64}" style="
|
| 136 |
width: {new_w}px;
|
| 137 |
height: {new_h}px;
|
| 138 |
display: block;
|
|
|
|
| 139 |
" />
|
| 140 |
</div>
|
| 141 |
<p style="font-size: 12px; color: #666; margin-top: 5px;">
|
|
|
|
| 86 |
border: 1px solid #ccc;
|
| 87 |
border-radius: 4px;
|
| 88 |
overflow: auto;
|
|
|
|
| 89 |
max-height: 600px;
|
| 90 |
padding: 10px;
|
| 91 |
background-color: #f9f9f9;
|
| 92 |
+
display: inline-block;
|
| 93 |
">
|
| 94 |
<img src="data:image/png;base64,{img_base64}" style="
|
| 95 |
width: {new_w}px;
|
| 96 |
height: {new_h}px;
|
| 97 |
display: block;
|
| 98 |
+
image-rendering: crisp-edges;
|
| 99 |
" />
|
| 100 |
</div>
|
| 101 |
<p style="font-size: 12px; color: #666; margin-top: 5px;">
|
|
|
|
| 128 |
border: 1px solid #ccc;
|
| 129 |
border-radius: 4px;
|
| 130 |
overflow: auto;
|
|
|
|
| 131 |
max-height: 600px;
|
| 132 |
padding: 10px;
|
| 133 |
background-color: #f9f9f9;
|
| 134 |
+
display: inline-block;
|
| 135 |
">
|
| 136 |
<img src="data:image/png;base64,{img_base64}" style="
|
| 137 |
width: {new_w}px;
|
| 138 |
height: {new_h}px;
|
| 139 |
display: block;
|
| 140 |
+
image-rendering: crisp-edges;
|
| 141 |
" />
|
| 142 |
</div>
|
| 143 |
<p style="font-size: 12px; color: #666; margin-top: 5px;">
|