Changeset 838

Show
Ignore:
Timestamp:
03/30/08 21:11:52 (4 months ago)
Author:
astrange
Message:

Fix the \fsp tag and allow negative numbers in \pos.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Subtitles/SubATSUIRenderer.m

    r806 r838  
    334334                Fixed tracking = FloatToFixed(s->tracking); 
    335335                 
    336                 SetATSUStyleOther(style, kATSUTrackingTag, sizeof(Fixed), &tracking); 
     336                SetATSUStyleOther(style, kATSUAfterWithStreamShiftTag, sizeof(Fixed), &tracking); 
    337337        } 
    338338         
     
    473473                case tag_fsp: 
    474474                        fixv(); 
    475                         SetATSUStyleOther(spanEx->style, kATSUTrackingTag, sizeof(Fixed), &fixval); 
     475                        SetATSUStyleOther(spanEx->style, kATSUAfterWithStreamShiftTag, sizeof(Fixed), &fixval); 
    476476                        break; 
    477477                case tag_frz: 
     
    988988                ATSUTextMeasurement imageWidth, imageHeight; 
    989989 
    990                 if (div->posX != -1 || div->alignV == kSubAlignmentMiddle) GetTypographicRectangleForLayout(layout, breaks, breakCount, FloatToFixed(div->styleLine->outlineRadius), NULL, NULL, &imageHeight, &imageWidth); 
    991  
    992                 if (div->posX == -1) { 
     990                if (div->posX != kSubPositionNone || div->alignV == kSubAlignmentMiddle) GetTypographicRectangleForLayout(layout, breaks, breakCount, FloatToFixed(div->styleLine->outlineRadius), NULL, NULL, &imageHeight, &imageWidth); 
     991 
     992                if (div->posX == kSubPositionNone) { 
    993993                        penX = FloatToFixed(NSMinX(marginRect)); 
    994994 
  • trunk/Subtitles/SubContext.h

    r806 r838  
    1616enum {kSubAlignmentBottom, kSubAlignmentMiddle, kSubAlignmentTop}; 
    1717enum {kSubBorderStyleNormal = 1, kSubBorderStyleBox = 3}; 
     18enum {kSubPositionNone = INT_MAX}; 
    1819 
    1920typedef ATSURGBAlphaColor SubRGBAColor; 
  • trunk/Subtitles/SubParsing.m.rl

    r806 r838  
    6262                spans = nil; 
    6363                 
    64                 posX = posY = -1
     64                posX = posY = kSubPositionNone
    6565                alignH = kSubAlignmentMiddle; alignV = kSubAlignmentBottom; 
    6666                 
     
    341341                                color = ("H"|"&"){,2} (xdigit+) >paramset %sethexnum "&"?; 
    342342                                parens = "(" [^)]* ")"; 
    343                                 xypos = ("(" [0-9]+ "," [0-9]+ ")") >paramset %setxypos; 
     343                                xypos = ("(" "-"? [0-9]+ "," "-"? [0-9]+ ")") >paramset %setxypos; 
    344344                                 
    345345                                cmd = "\\" (