Ticket #7183 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

A scroll-bars are always appear around image

Reported by: g1itch Assigned to: richard
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  
    118118                    w_unit = "pt" 
    119119                    h_unit = "pt" 
    120120 
     121        w_val += 1 
     122        h_val += 1 
    121123 
    122124                dimensions = 'width="%(w_val)s%(w_unit)s" height="%(h_val)s%(h_unit)s"' % locals() 
    123125            except: 

I think 1 pt is not much, but it's enough to remove scroll-bars.

Attachments

Change History

05/31/10 15:34:37 changed by g1itch

Unfortunately I cannot edit description, but more precisely patch might be

  • imagesvg/web_ui.py

    old new  
    118118                    w_unit = "pt" 
    119119                    h_unit = "pt" 
    120120 
     121                if w_unit != '%': 
     122                    w_val += 1 
     123                    h_val += 1 
    121124 
    122125                dimensions = 'width="%(w_val)s%(w_unit)s" height="%(h_val)s%(h_unit)s"' % locals() 
    123126            except: 

in order to make possible scaling svg with viewBox set.

(follow-up: ↓ 3 ) 06/02/10 05:58:22 changed by richard

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)]]

(in reply to: ↑ 2 ) 06/02/10 14:38:47 changed by g1itch

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?

06/03/10 03:06:50 changed by richard

  • status changed from new to closed.
  • resolution set to fixed.

fixed in [8063]


Add/Change #7183 (A scroll-bars are always appear around image)




Change Properties
Action