public static void Invalidate(dfFontBase font) { if (font == null || !(font is dfDynamicFont)) { return; } if (!dirty.Contains(font)) { dirty.Add(font); } }
public void OnClick(dfControl sender, dfMouseEventArgs args) { // No need to do anything unless an actual item was clicked if (args.Source == container) { return; } // Do not process click event if the user was scrolling by // dragging the mouse. Not needed for mobile. if (Vector2.Distance(args.Position, touchStartPosition) > 20) { return; } // Find highest-level control containing the click var source = args.Source; while (source != null && !controls.Contains(source)) { source = source.Parent; } // If an item in the scroller was clicked, select it if (source != null) { // Select the clicked item lastSelected = -1; setSelectedIndex(controls.IndexOf(source)); // Do not need to try to select "most centered" item isMouseDown = false; } }
public void Release() { this.source = null; this.index = 0; if (!pool.Contains(this)) { pool.Add(this); } }
public static void FlagPendingRequests(dfFontBase font) { var dynamicFont = font as dfDynamicFont; if (dynamicFont != null) { if (!rebuildList.Contains(dynamicFont)) { rebuildList.Add(dynamicFont); } } }
public void Release() { if (this.Key != null) { this.Key.Release(); this.Key = null; } if (this.Value != null) { this.Value.Release(); this.Value = null; } if (!pool.Contains(this)) { pool.Add(this); } }