Vous êtes sur le site Web historique de la documentation de 4D. Les documentations sont progressivement déplacées vers developer.4d.com

Accueil

 
4D v20 R7
SVG_SET_STROKE_VECTOR_EFFECT

SVG_SET_STROKE_VECTOR_EFFECT 


 

SVG_SET_STROKE_VECTOR_EFFECT ( svgObj {; vectorEffect} ) 
Paramètre Type   Description
svgObj  Ref_SVG in Reference of SVG element
vectorEffect  Chaîne in "non-scaling-stroke", "none", "inherit"

The SVG_SET_STROKE_VECTOR_EFFECT command sets the vector-effect attribute for the lines of the svgObj. The vector-effect attribute specifies the behavior of an object's stroke if the object is transformed, for example by zooming in or out. 

In the svgObj parameter, pass a reference to the SVG element whose vector-effect attribute will be set. If svgObj does not reference an SVG element, an error is generated. If the vector-effect attribute has already been defined, its value is replaced by the vectorEffect parameter.

The optional vectorEffect parameter indicates the value to be used for the attribute. The following values are available:

 

vectorEffectDescription
"non-scaling-stroke"Stroke (line) width is not dependant on the transformations of the element 
"none"No vector effect is applied
"inherit"The value of the element's parent is used

If vectorEffect is omitted, the vector-effect attribute is removed (equivalent to "none"). 

Exemple  

The following code creates a rectangle and resizes it:

 C_TEXT($Dom_rect;$Dom_svg)
 $Dom_svg:=SVG_New
 $Dom_rect:=SVG_New_rect($Dom_svg;10;10;100;100;0;0;"blue";"red")
 SVG_SET_STROKE_WIDTH($Dom_rect;2;"px")
 
  // Redimension
 SVG_SET_TRANSFORM_SCALE($Dom_rect;4;1)

By default, line thickness is modified: 

To resize without changing line thickness, add SVG_SET_STROKE_VECTOR_EFFECT:

 C_TEXT($Dom_rect;$Dom_svg)
 $Dom_svg:=SVG_New
 $Dom_rect:=SVG_New_rect($Dom_svg;10;10;100;100;0;0;"blue";"red")
 SVG_SET_STROKE_WIDTH($Dom_rect;2;"px")
 
  // Redimension
 SVG_SET_TRANSFORM_SCALE($Dom_rect;4;1)
 
  // Set non-scalling
 SVG_SET_STROKE_VECTOR_EFFECT($Dom_rect;"non-scaling-stroke")

The line thickness is not modified:

 
PROPRIÉTÉS 

Produit : 4D
Thème : Attributs

Commande(s) éligible(s) à l'exécution dans un process préemptif

 
PAGE CONTENTS 
 
HISTORIQUE 

Créé : 4D v18

 
UTILISATION DE L'ARTICLE

4D SVG ( 4D v20 R7)