Opened 14 years ago
Closed 14 years ago
#7183 closed defect (fixed)
A scroll-bars are always appear around image
Reported by: | Dmitri | Owned by: | Richard Liao |
---|---|---|---|
Priority: | normal | Component: | TracImageSvgMacro |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
In Firefox 3.5 and 3.6 I always see the scroll-bars around image, displayed by you plugin. It may be wrong, but I solved this problem by this modification:
-
imagesvg/web_ui.py
old new 118 118 w_unit = "pt" 119 119 h_unit = "pt" 120 120 121 w_val += 1 122 h_val += 1 121 123 122 124 dimensions = 'width="%(w_val)s%(w_unit)s" height="%(h_val)s%(h_unit)s"' % locals() 123 125 except:
I think 1 pt is not much, but it's enough to remove scroll-bars.
Attachments (0)
Change History (4)
comment:1 Changed 14 years ago by
comment:2 follow-up: 3 Changed 14 years ago by
If width and height are defined in the svg image, browser will try to display in the defined size. If the embed element is smaller than the size, scroll bars will appear. You can specify bigger element size like this:
[[ImageSvg(example.svg, 800, 600)]]
comment:3 Changed 14 years ago by
Replying to richard:
If the embed element is smaller than the size, scroll bars will appear.
You right. I looked more closely and see that scroll bars appear for attributes like
width="589.61224" height="370.06125"
For integer values all correct. svg-files are made with inkscape. May be some rounding procedure should be applied to w_val, h_val
?
Unfortunately I cannot edit description, but more precisely patch might be
imagesvg/web_ui.py
in order to make possible scaling svg with
viewBox
set.