private async Task OnZoomChanged() { ZoomChanged?.Invoke(this, new RoutedEventArgs()); await UpdateZoom(); TransportControls?.UpdateZoomButton(); }
private void mapControl_OnMapZoomChanged() { if (ZoomChanged != null) { ZoomChanged.Invoke(mapControl, EventArgs.Empty); } }
protected override void NewTitle(string title) { if (!String.IsNullOrEmpty(title)) { double newLat, newLong, newZoom; // Incoming title should look like "6, (-27.15, 151.25)" // That is Zoom, then lat, long pair // We remove the brackets and split on the commas title = title.Replace("(", ""); title = title.Replace(")", ""); string[] parts = title.Split(new char[] { ',' }); if (Double.TryParse(parts[0], out newZoom) && newZoom != _zoom) { _zoom = newZoom; if (ZoomChanged != null) { ZoomChanged.Invoke(this, EventArgs.Empty); } } if (Double.TryParse(parts[1], out newLat) && Double.TryParse(parts[2], out newLong) && (newLat != _center.Latitude || newLong != Center.Longitude)) { _center.Latitude = newLat; _center.Longitude = newLong; if (PositionChanged != null) { PositionChanged.Invoke(this, EventArgs.Empty); } } } }
private void vZoom_ValueChanged(object sender, EventArgs e) { if (ZoomChanged != null) { ZoomChanged.Invoke(this, EventArgs.Empty); } }
private void selectedIndexChanged(object sender, EventArgs e) { spriteGrid1.Zoom = zoom.SelectedIndex + 1; spriteGrid1.Size = new Size(spriteGrid1.MaximumSize.Width, spriteGrid1.MaximumSize.Height); AdaptSize(); ZoomChanged?.Invoke(); }
/// <summary> /// Apply the new animated _zoom value to the actual ScaleTransform and fire the ZoomChanged event. /// </summary> void OnZoomChanged() { _scale.ScaleX = _scale.ScaleY = _zoom; ZoomChanged?.Invoke(this, EventArgs.Empty); // focus rectangles may need to be repainted. _target.InvalidateVisual(); }
internal void SetZoom(int zoom, bool invoke = false) { if (scintilla.Margins[0].Width > 0) { scintilla.Margins[0].Width = Math.Max(20, 30 + 3 * zoom); } if (scintilla.Zoom != zoom) { scintilla.Zoom = zoom; } if (invoke) { ZoomChanged?.Invoke(this, scintilla.Zoom); } }
/// <summary> /// Internal handler for the zoom changed event. /// </summary> protected void OnZoomChanged() { if (ZoomChanged != null) ZoomChanged.Invoke(this); if (m_ZoomedSection == -1) { if (PanelUnZoomed != null) PanelUnZoomed.Invoke(this); } else { if (PanelZoomed != null) PanelZoomed.Invoke(this); } }
/// <summary> /// Zoom to the given factor. /// </summary> /// <param name='zoom'> /// A zoom factor, expressed as a double. /// </param> /// <param name='x'> /// The point of the viewport around which to zoom. /// </param> /// <param name='y'> /// The point of the viewport around which to zoom. /// </param> void DoZoom(double zoom, int x, int y) { Fit = zoom == MIN_ZOOM; if (zoom == this.zoom || Math.Abs(this.zoom - zoom) < Double.Epsilon) { // Don't recalculate if the zoom factor stays the same. return; } // Clamp the zoom factor within the [ MIN_ZOOM , MAX_ZOOM ] interval. zoom = Math.Max(Math.Min(zoom, MAX_ZOOM), MIN_ZOOM); this.zoom = zoom; int x_offset = scaled_width < Allocation.Width ? (int)(Allocation.Width - scaled_width) / 2 : -XOffset; int y_offset = scaled_height < Allocation.Height ? (int)(Allocation.Height - scaled_height) / 2 : -YOffset; double x_anchor = (double)(x - x_offset) / (double)scaled_width; double y_anchor = (double)(y - y_offset) / (double)scaled_height; ComputeScaledSize(); AdjustmentsChanged -= ScrollToAdjustments; if (scaled_width < Allocation.Width) { Hadjustment.Value = XOffset = 0; } else { Hadjustment.Value = XOffset = Clamp((int)(x_anchor * scaled_width - x), 0, (int)(Hadjustment.Upper - Hadjustment.PageSize)); } if (scaled_height < Allocation.Height) { Vadjustment.Value = YOffset = 0; } else { Vadjustment.Value = YOffset = Clamp((int)(y_anchor * scaled_height - y), 0, (int)(Vadjustment.Upper - Vadjustment.PageSize)); } AdjustmentsChanged += ScrollToAdjustments; ZoomChanged?.Invoke(this, EventArgs.Empty); QueueDraw(); }
private void UpdateMatrices() { zoom = Utils.Clamp(0.25f, 4.00f, zoom); if (Math.Abs(zoom - zoomLast) > 0.01f) { zoomLast = zoom; ZoomChanged?.Invoke(this, zoom); } transformation.Reset(); transformation.Translate(translation.X, translation.Y); transformation.Scale(zoom, zoom); inverse_transformation.Reset(); inverse_transformation.Scale(1.0f / zoom, 1.0f / zoom); inverse_transformation.Translate(-translation.X, -translation.Y); }
/// <summary> /// Internal handler for the zoom changed event. /// </summary> protected void OnZoomChanged() { if (ZoomChanged != null) { ZoomChanged.Invoke(this, EventArgs.Empty); } if (m_ZoomedSection == -1) { if (PanelUnZoomed != null) { PanelUnZoomed.Invoke(this, EventArgs.Empty); } } else { if (PanelZoomed != null) { PanelZoomed.Invoke(this, EventArgs.Empty); } } }
protected override void OnSizeAllocated(Gdk.Rectangle allocation) { min_zoom = ComputeMinZoom(upscale); if (Fit || zoom < MIN_ZOOM) { zoom = MIN_ZOOM; } // Since this affects the zoom_scale we should alert it ZoomChanged?.Invoke(this, EventArgs.Empty); ComputeScaledSize(); OnSizeAllocatedChildren(); if (IsRealized) { GdkWindow.MoveResize(allocation.X, allocation.Y, allocation.Width, allocation.Height); } if (XOffset > Hadjustment.Upper - Hadjustment.PageSize) { ScrollTo((int)(Hadjustment.Upper - Hadjustment.PageSize), YOffset, false); } if (YOffset > Vadjustment.Upper - Vadjustment.PageSize) { ScrollTo(XOffset, (int)(Vadjustment.Upper - Vadjustment.PageSize), false); } base.OnSizeAllocated(allocation); if (Fit) { ZoomFit(upscale); } }
protected virtual void OnZoomChanged(object sender, EventArgs e) { float.TryParse(txtZoom.Text, out _zoom); _eventArgs.Zoom = _zoom; ZoomChanged?.Invoke(this, _eventArgs); }
private void OnZoomChanged(object sender, ZoomLevelChangedEventArgs args) { ZoomChanged?.Invoke((IWpfTextView)sender, args.NewZoomLevel); }
/// <summary> /// Raises the ZoomChanged event when the zoom factor changed. /// </summary> protected virtual void OnZoomChanged(EventArgs e) { ZoomChanged?.Invoke(this, e); }
private void zoomSelectedIndexChanged(object sender, EventArgs e) { ZoomChanged?.Invoke(zoom.SelectedIndex + 1); }
void HandleStaticZoomChanged(object sender, EventArgs e) { DisposeFont(); ZoomChanged?.Invoke(this, EventArgs.Empty); OnChanged(EventArgs.Empty); }
private void OnZoomChanged(EventArgs e) { ZoomChanged?.Invoke(this, e); }
private void txtExpression_ZoomChanged(object sender, EventArgs e) { ZoomChanged?.Invoke(this, txtExpression.Zoom); }
private void DecreaseZoomButton_Click(object sender, EventArgs e) { ZoomChanged.Invoke(-1); }
private void OnZoomChanged() { ZoomChanged?.Invoke(this, new CanvasZoomChangedEventArgs(zoomFactor)); }
private void SetZoom(float value) { _zoom = Max(0f, value); RefreshImage(); ZoomChanged?.Invoke(this, new EventArgs()); }
protected virtual void OnZoomChanged() { ZoomChanged?.Invoke(this, EventArgs.Empty); }
public void SetZoom(double newZoom) { Zoom = newZoom; ZoomChanged?.Invoke(); Refresh(); }
void OnZoomChanged() { ZoomChanged?.Invoke(this, EventArgs.Empty); }
private void RaiseZoomChanged() { ZoomChanged?.Invoke(this, new EventArgs()); }