public Rect GetRect(bool inLocal = true) { Rect parent_rect; if (Parent != null) { parent_rect = Parent.GetClientRect(); //global rect } else { parent_rect = new Rect(); } PVector2 pivot_by_parent = GetBaseParam(SWindowParamDescr.Indent).ToPVector2(); Vector2 parent_shift = pivot_by_parent.GetVector(parent_rect); Vector2 c = parent_shift; if (!inLocal) { c = c + parent_rect.Min; //global pos } PVector2 size = GetBaseParam(SWindowParamDescr.Size).ToPVector2(); Vector2 sz = size.GetVector(parent_rect); PVector2 pivot_in_own_rect = GetBaseParam(SWindowParamDescr.Shift).ToPVector2(); Vector2 own_shift = pivot_in_own_rect.GetVector(sz); Vector2 lt = c - own_shift; return(new Rect(lt.x, lt.y, lt.x + sz.x, lt.y + sz.y)); }
public override bool SetValue(PVector2 inNewValue) { bool diff = _value != inNewValue; if (diff) { _value = inNewValue; } return(diff); }
public virtual bool SetValue(PVector2 inNewValue) { throw new NotImplementedException(); }
public CPVectorParam(PVector2 value) { _value = value; }