Changeset 2909 for trunk/sources/HeuristicLab.ExtLibs
- Timestamp:
- 03/02/10 11:28:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/NetronVisualization.cs
r2868 r2909 49 49 this.Controller = new Controller(this); 50 50 this.Document = new Document(); 51 this.Document.Model.Selection = new Selection(this.Controller, this.Document.Model);51 this.Document.Model.Selection = new Selection(this.Controller, this.Document.Model); 52 52 this.View = new View(this); 53 53 this.AttachToDocument(Document); … … 59 59 60 60 this.SizeChanged += new EventHandler(NetronVisualization_SizeChanged); 61 this.AllowDrop = true; 61 this.UpdateView(); 62 } 63 } 64 65 public Size PageSize { 66 get { return this.View.PageSize; } 67 set { 68 this.View.PageSize = value; 69 this.UpdateView(); 70 } 71 } 72 73 private void UpdateView() { 74 //zoom in to show scrollbars - code taken from ControllerBase line 1082 75 SizeF s = this.View.Magnification; 76 float alpha = 1.1F; 77 View.Magnification = new SizeF( 78 s.Width * alpha, 79 s.Height * alpha); 80 81 float w = (float)this.AutoScrollPosition.X / 82 (float)this.AutoScrollMinSize.Width; 83 84 float h = (float)this.AutoScrollPosition.Y / 85 (float)this.AutoScrollMinSize.Height; 86 87 RectangleF pageBounds = this.Controller.Model.CurrentPage.Bounds; 88 pageBounds.Inflate(s); 89 SizeF deltaSize = new SizeF( 90 pageBounds.Width - this.ClientRectangle.Width, 91 pageBounds.Height - this.ClientRectangle.Height); 92 93 if ((deltaSize.Width > 0) && (deltaSize.Height > 0)) { 94 this.AutoScrollMinSize = Size.Round(deltaSize); 62 95 } 63 96 } … … 65 98 private void NetronVisualization_SizeChanged(object sender, EventArgs e) { 66 99 //if (this.oldSize == INVALID_SIZE) { 67 100 //this.View.PageSize = new Size((int)(this.Size.Width * this.Magnification.Width), (int)(this.Size.Height * this.Magnification.Height)); 68 101 // if (!this.DesignMode) 69 102 // oldSize = this.Size;
Note: See TracChangeset
for help on using the changeset viewer.