Relayout() private méthode

Redo layout. Should produce the same segments as FullLayout, but assume that segments for text up to details.StartChange may be reused (if not affected by changing line breaks), and segments after details.StartChange+details.DeleteCount may be re-used if a line break works out (and after adjusting their begin offset).
private Relayout ( SourceChangeDetails details, LayoutCallbacks lcb ) : void
details SourceChangeDetails
lcb LayoutCallbacks
Résultat void
Exemple #1
0
        /// <summary>
        /// Redo the layout of the paragraph given the Source changes indicated in the given details.
        /// </summary>
        /// <param name="details"></param>
        private void Relayout(SourceChangeDetails details)
        {
            // We would prefer to keep both sources intact, but we can't just do Source = details.NewSource,
            // because there is currently no way to change the Source of existing segments we may want to reuse.
            Source.Copyfrom(details.NewSource);
            var oldHeight = Height;
            var oldWidth  = Width;

            using (var gh = Root.Site.DrawingInfo)
            {
                // Enhance JohnT: margins: need to adjust MaxWidth for margins and padding of containing boxes.
                var info = new LayoutInfo(ChildTransformFromRootTransform(gh.Transform), Root.LastLayoutInfo.MaxWidth,
                                          gh.VwGraphics, Root.LastLayoutInfo.RendererFactory);
                var builder = new ParaBuilder(this, info);
                using (var lcb = new LayoutCallbacks(Root))
                {
                    builder.Relayout(details, lcb);
                    if (Height != oldHeight || Width != oldWidth)
                    {
                        RelayoutParents(gh);
                    }
                }
            }
        }
Exemple #2
0
		/// <summary>
		/// Redo the layout of the paragraph given the Source changes indicated in the given details.
		/// </summary>
		/// <param name="details"></param>
		private void Relayout(SourceChangeDetails details)
		{
			// We would prefer to keep both sources intact, but we can't just do Source = details.NewSource,
			// because there is currently no way to change the Source of existing segments we may want to reuse.
			Source.Copyfrom(details.NewSource);
			var oldHeight = Height;
			var oldWidth = Width;
			using (var gh = Root.Site.DrawingInfo)
			{
				// Enhance JohnT: margins: need to adjust MaxWidth for margins and padding of containing boxes.
				var info = new LayoutInfo(ChildTransformFromRootTransform(gh.Transform), Root.LastLayoutInfo.MaxWidth,
					gh.VwGraphics, Root.LastLayoutInfo.RendererFactory);
				var builder = new ParaBuilder(this, info);
				using (var lcb = new LayoutCallbacks(Root))
				{
					builder.Relayout(details, lcb);
					if (Height != oldHeight || Width != oldWidth)
						RelayoutParents(gh);
				}
			}
		}