+ /// <summary>
+ /// The fitting mode of the visual.
+ /// The default is defined by the type of visual (if it is suitable to be stretched or not).
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public VisualFittingModeType VisualFittingMode
+ {
+ get
+ {
+ if (_visualFittingMode == null)
+ {
+ if (this is AnimatedImageVisual ||
+ this is MeshVisual ||
+ this is PrimitiveVisual ||
+ this is TextVisual)
+ {
+ return VisualFittingModeType.FitKeepAspectRatio;
+ }
+ else
+ {
+ return VisualFittingModeType.Fill;
+ }
+ }
+ else
+ {
+ return (VisualFittingModeType)_visualFittingMode;
+ }
+ }
+ set
+ {
+ _visualFittingMode = value;
+ UpdateVisual();
+ }
+ }
+
+ internal string Name
+ {
+ set;
+ get;
+ }
+
+ internal int VisualIndex
+ {
+ set;
+ get;
+ }
+
+ internal VisualView Parent
+ {
+ set;
+ get;
+ }
+
+ internal void UpdateVisual()
+ {
+ if (VisualIndex > 0)
+ {
+ NUILog.Debug("UpdateVisual()! VisualIndex=" + VisualIndex);
+ Parent.UpdateVisual(VisualIndex, Name, this);
+ }
+ else
+ {
+ NUILog.Debug("VisualIndex was not set");
+ }
+ }
+
+ /// <summary>
+ /// Compose the out visual map.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected virtual void ComposingPropertyMap()
+ {
+ _outputVisualMap = new PropertyMap();
+ }
+
+ private void ComposingTransformMap()
+ {
+ _visualTransformMap = new PropertyMap();
+ if (_visualSize != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Size, new PropertyValue(_visualSize)); }
+ if (_visualOffset != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(_visualOffset)); }
+ if (_visualOffsetPolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(_visualOffsetPolicy)); }
+ if (_visualSizePolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(_visualSizePolicy)); }
+ if (_visualOrigin != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)_visualOrigin)); }
+ if (_visualAnchorPoint != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)_visualAnchorPoint)); }
+ }
+