コード例 #1
0
        // ------------------------------------------------------------------
        // Create new margin collapsing state and collapse margins if necessary.
        // If no collapsing happens, retrieve margin from old collapsing state.
        // This margin value should be used to advance pen.
        // ------------------------------------------------------------------
        internal static void CollapseTopMargin(
            PtsContext ptsContext,              // Current PTS Context.
            MbpInfo mbp,                        // MBP information for element entering the scope
            MarginCollapsingState mcsCurrent,   // current margin collapsing state (adjacent to the new one).
            out MarginCollapsingState mcsNew,   // margin collapsing state for element entering the scope
            out int margin)                     // collapsed margin value
        {
            margin = 0;
            mcsNew = null;

            // Create new margin collapsing info
            mcsNew = new MarginCollapsingState(ptsContext, mbp.MarginTop);
            // collapse margins, if current margin collapsing exists
            if (mcsCurrent != null)
            {
                mcsNew.Collapse(mcsCurrent);
            }

            // If border or paddind is specified:
            // (1) get collapsed margin value
            // (2) set new mcs to null, because we don't have one anymore
            if (mbp.BPTop != 0)
            {
                margin = mcsNew.Margin;
                mcsNew.Dispose();
                mcsNew = null;
            }
            else if (mcsCurrent == null && DoubleUtil.IsZero(mbp.Margin.Top))
            {
                // No need to create new margin collapsing info
                mcsNew.Dispose();
                mcsNew = null;
            }
        }
コード例 #2
0
        // ------------------------------------------------------------------
        // Create new margin collapsing state and collapse margins if necessary.
        // If no collapsing happens, retrieve margin from old collapsing state.
        // This margin value should be used to advance pen.
        // ------------------------------------------------------------------
        internal static void CollapseTopMargin(
            PtsContext ptsContext,              // Current PTS Context.
            MbpInfo mbp,                        // MBP information for element entering the scope
            MarginCollapsingState mcsCurrent,   // current margin collapsing state (adjacent to the new one).
            out MarginCollapsingState mcsNew,   // margin collapsing state for element entering the scope
            out int margin)                     // collapsed margin value
        {
            margin = 0;
            mcsNew = null;

            // Create new margin collapsing info
            mcsNew = new MarginCollapsingState(ptsContext, mbp.MarginTop);
            // collapse margins, if current margin collapsing exists
            if (mcsCurrent != null)
            {
                mcsNew.Collapse(mcsCurrent);
            }

            // If border or paddind is specified:
            // (1) get collapsed margin value
            // (2) set new mcs to null, because we don't have one anymore
            if (mbp.BPTop != 0)
            {
                margin = mcsNew.Margin;
                mcsNew.Dispose();
                mcsNew = null;
            }
            else if (mcsCurrent == null && DoubleUtil.IsZero(mbp.Margin.Top))
            {
                // No need to create new margin collapsing info
                mcsNew.Dispose();
                mcsNew = null;
            }
        }
コード例 #3
0
 // Token: 0x060068B1 RID: 26801 RVA: 0x001D8CE8 File Offset: 0x001D6EE8
 internal static void CollapseTopMargin(PtsContext ptsContext, MbpInfo mbp, MarginCollapsingState mcsCurrent, out MarginCollapsingState mcsNew, out int margin)
 {
     margin = 0;
     mcsNew = null;
     mcsNew = new MarginCollapsingState(ptsContext, mbp.MarginTop);
     if (mcsCurrent != null)
     {
         mcsNew.Collapse(mcsCurrent);
     }
     if (mbp.BPTop != 0)
     {
         margin = mcsNew.Margin;
         mcsNew.Dispose();
         mcsNew = null;
         return;
     }
     if (mcsCurrent == null && DoubleUtil.IsZero(mbp.Margin.Top))
     {
         mcsNew.Dispose();
         mcsNew = null;
     }
 }