Dies ist die alte 4D Dokumentations-Website. Die neue und aktualisierte Dokumentation finden Sie unter developer.4d.com

Home

 
4D v20 R8
SVG_SET_STROKE_VECTOR_EFFECT

SVG_SET_STROKE_VECTOR_EFFECT 


 

SVG_SET_STROKE_VECTOR_EFFECT ( svgObj {; vectorEffect} ) 
Parameter Typ   Beschreibung
svgObj  SVG_Ref in Reference of SVG element
vectorEffect  String 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"). 

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:

 
EIGENSCHAFTEN 

Produkt: 4D
Thema: Attributes

Dieser Befehl kann in preemptive Prozessen laufen

 
SEITENINHALT 
 
GESCHICHTE 

Erstellt: 4D v18

 
ARTIKELVERWENDUNG

4D SVG ( 4D v20 R8)