public static string GetPropertyName(StyleProperty property) { string name; s_NameMap.TryGetValue((int)property.propertyId, out name); return(name); }
internal bool SetInheritedStyle(StyleProperty property) { if (propertyMap.ContainsKey((int)property.propertyId)) { return(false); } int key = BitUtil.SetHighLowBits(1, (int)property.propertyId); StyleProperty current; if (propertyMap.TryGetValue(key, out current)) { if (current != property) { propertyMap[key] = property; return(true); } return(false); } else { propertyMap[key] = property; return(true); } }
internal bool SetInheritedStyle(StyleProperty property) { if (propertyMap.ContainsKey((int)property.propertyId)) { return(false); } StyleProperty current = inheritedProperties[(int)property.propertyId]; if (current != property) { inheritedProperties[(int)property.propertyId] = property; return(true); } return(false); }
public override void OnStylePropertyChanged(StructList <StyleProperty> propertyList) { StyleProperty[] properties = propertyList.array; int count = propertyList.size; base.OnStylePropertyChanged(propertyList); for (int i = 0; i < count; i++) { ref StyleProperty property = ref properties[i]; switch (property.propertyId) { case StylePropertyId.MeshFillAmount: meshFillAmount = property.AsFloat; geometryNeedsUpdate = true; break; case StylePropertyId.MeshType: meshType = property.AsMeshType; geometryNeedsUpdate = true; break; case StylePropertyId.MeshFillDirection: meshFillDirection = property.AsMeshFillDirection; geometryNeedsUpdate = true; break; case StylePropertyId.MeshFillOrigin: meshFillOrigin = property.AsMeshFillOrigin; geometryNeedsUpdate = true; break; case StylePropertyId.Material: materialId = property.AsMaterialId; break; case StylePropertyId.BackgroundTint: backgroundTint = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BackgroundColor: backgroundColor = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BorderColorTop: borderColorTop = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BorderColorRight: borderColorRight = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BorderColorBottom: borderColorBottom = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BorderColorLeft: borderColorLeft = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BackgroundImage: backgroundImage = property.AsTexture; dataNeedsUpdate = true; break; case StylePropertyId.BorderRadiusBottomLeft: borderRadiusBottomLeft = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.BorderRadiusBottomRight: borderRadiusBottomRight = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.BorderRadiusTopLeft: borderRadiusTopLeft = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.BorderRadiusTopRight: borderRadiusTopRight = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.Opacity: opacity = property.AsFloat; dataNeedsUpdate = true; break; case StylePropertyId.CornerBevelTopLeft: cornerBevelTopLeft = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.CornerBevelTopRight: cornerBevelTopRight = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.CornerBevelBottomRight: cornerBevelBottomRight = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.CornerBevelBottomLeft: cornerBevelBottomLeft = property.AsUIFixedLength; dataNeedsUpdate = true; break; case StylePropertyId.ShadowColor: shadowColor = property.AsColor; dataNeedsUpdate = true; break; case StylePropertyId.BackgroundFit: case StylePropertyId.BackgroundImageScaleX: case StylePropertyId.BackgroundImageScaleY: case StylePropertyId.BackgroundImageRotation: case StylePropertyId.BackgroundImageTileX: case StylePropertyId.BackgroundImageTileY: case StylePropertyId.BackgroundImageOffsetX: case StylePropertyId.BackgroundImageOffsetY: case StylePropertyId.ShadowTint: case StylePropertyId.ShadowOffsetX: case StylePropertyId.ShadowOffsetY: case StylePropertyId.ShadowSizeX: case StylePropertyId.ShadowSizeY: case StylePropertyId.ShadowIntensity: dataNeedsUpdate = true; break; // shadowNeedsUpdate = true; // break; } }