Ticket #427: atsui-outer-stroke.diff

File atsui-outer-stroke.diff, 1.7 KB (added by astrange, 5 years ago)
  • Subtitles/SubATSUIRenderer.m

     
    10011001                borderRect.size.height = ceil(borderRect.size.height); 
    10021002                 
    10031003                CGContextFillRect(c, borderRect); 
     1004        } else if (textType == kTextLayerOutline) { 
     1005                CGContextSaveGState(c); 
     1006                CGContextSetTextDrawingMode(c, kCGTextClip); 
     1007                ATSUDrawText(layout, thisBreak, lineLen, RoundFixed(penX), RoundFixed(penY)); 
     1008                CGContextSetTextDrawingMode(c, kCGTextStroke); 
     1009                ATSUDrawText(layout, thisBreak, lineLen, RoundFixed(penX), RoundFixed(penY)); 
     1010                CGContextRestoreGState(c); 
    10041011        } else ATSUDrawText(layout, thisBreak, lineLen, RoundFixed(penX), RoundFixed(penY)); 
    10051012} 
    10061013 
     
    10701077{ 
    10711078        SubATSUISpanEx *firstSpanEx = ((SubRenderSpan*)[div->spans objectAtIndex:0])->ex; 
    10721079        BOOL endLayer = NO; 
    1073          
     1080        Fixed newPenY; 
     1081                 
    10741082        if (div->styleLine->borderStyle == kSubBorderStyleNormal && firstSpanEx->shadowDist) { 
    10751083                if (!(div->render_complexity & renderManualShadows)) { 
    10761084                        endLayer = YES; 
     
    10791087                } else DrawTextLines(c, layout, div, breakc, penX, penY, firstSpanEx, kTextLayerShadow); 
    10801088        } 
    10811089         
     1090        newPenY = DrawTextLines(c, layout, div, breakc, penX, penY, firstSpanEx, kTextLayerPrimary); 
    10821091        DrawTextLines(c, layout, div, breakc, penX, penY, firstSpanEx, kTextLayerOutline); 
    1083         penY = DrawTextLines(c, layout, div, breakc, penX, penY, firstSpanEx, kTextLayerPrimary); 
    1084          
     1092 
    10851093        if (endLayer) { 
    10861094                CGContextEndTransparencyLayer(c); 
    10871095                CGContextSetShadowWithColor(c, CGSizeMake(0,0), 0, NULL); 
    10881096        } 
    10891097         
    1090         return penY; 
     1098        return newPenY; 
    10911099} 
    10921100 
    10931101#pragma mark Main Renderer Function