Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
050a3207
by Alexei Podtelezhnikov (Алексей Подтележников) at 2023-11-15T23:41:56-05:00
1 changed file:
Changes:
... | ... | @@ -116,8 +116,8 @@ |
116 | 116 | * generated until the end of the outline.
|
117 | 117 | *
|
118 | 118 | * Note that, for all generated profiles, the function End_Profile()
|
119 | - * is used to record their bottom-most scanline as well as the
|
|
120 | - * scanline above its upmost boundary. These positions are called
|
|
119 | + * is used to record all their bottom-most scanlines as well as the
|
|
120 | + * scanline above their upmost boundary. These positions are called
|
|
121 | 121 | * `y-turns' because they (sort of) correspond to local extrema.
|
122 | 122 | * They are stored in a sorted list built from the top of the render
|
123 | 123 | * pool as a downwards stack:
|
... | ... | @@ -579,12 +579,17 @@ |
579 | 579 | * SUCCESS on success. FAILURE in case of overflow.
|
580 | 580 | */
|
581 | 581 | static Bool
|
582 | - Insert_Y_Turn( RAS_ARGS Int y )
|
|
582 | + Insert_Y_Turns( RAS_ARGS Int y,
|
|
583 | + Int top )
|
|
583 | 584 | {
|
584 | 585 | Int n = ras.numTurns;
|
585 | 586 | PLong y_turns = ras.maxBuff;
|
586 | 587 | |
587 | 588 | |
589 | + /* update top value */
|
|
590 | + if ( n == 0 || top > y_turns[n] )
|
|
591 | + y_turns[n] = top;
|
|
592 | + |
|
588 | 593 | /* look for first y value that is <= */
|
589 | 594 | while ( n-- && y < y_turns[n] )
|
590 | 595 | ;
|
... | ... | @@ -751,8 +756,7 @@ |
751 | 756 | p->X = p->x[h - 1];
|
752 | 757 | }
|
753 | 758 | |
754 | - if ( Insert_Y_Turn( RAS_VARS bottom ) ||
|
|
755 | - Insert_Y_Turn( RAS_VARS top ) )
|
|
759 | + if ( Insert_Y_Turns( RAS_VARS bottom, top ) )
|
|
756 | 760 | return FAILURE;
|
757 | 761 | |
758 | 762 | if ( !ras.gProfile )
|
... | ... | @@ -1820,7 +1824,7 @@ |
1820 | 1824 | ras.cProfile = NULL;
|
1821 | 1825 | |
1822 | 1826 | ras.top = ras.buff;
|
1823 | - ras.maxBuff = ras.sizeBuff;
|
|
1827 | + ras.maxBuff = ras.sizeBuff - 1; /* top reserve */
|
|
1824 | 1828 | |
1825 | 1829 | ras.numTurns = 0;
|
1826 | 1830 | ras.num_Profs = 0;
|