Changeset 429


Ignore:
Timestamp:
Apr 26, 2019, 5:06:54 AM (6 years ago)
Author:
ataylor
Message:

Fixed unintialized variable causing rare glitch in cursor positioning on click.
Text wrap width calculation now takes both left and right margins into account.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Components/RichTextLayoutUnit.pas

    r423 r429  
    389389
    390390  WrapX := FLayoutWidth
     391           - Style.LeftMargin                   // ALT
     392             * FontWidthPrecisionFactor
    391393           - FRichTextSettings.Margins.Right
    392394             * FontWidthPrecisionFactor;
     
    12301232                                              ): LongInt;                   // returns new offset within line
    12311233var
    1232   P:         PChar;             // pointer to current character in string
    1233   NextP:     PChar;             // pointer to the following character, if any
    1234   Element:   TTextElement;      // element data about the current character
    1235   CurrentPos:  LongInt;           // index of first character of line
    1236   Line:      LongInt;           // current line number
    1237   Offset:    LongInt;           // offset position within current line
    1238   InsideDBC: boolean;
    1239 begin
    1240   if ( Offset > 0 ) and
    1241      ( Codepage in [ 932, 936, 942, 943, 949, 950, 1381, 1386 ]) then
     1234  P:          PChar;            // pointer to current character in string
     1235  NextP:      PChar;            // pointer to the following character, if any
     1236  Element:    TTextElement;     // element data about the current character
     1237  CurrentPos: LongInt;          // index of first character of line
     1238  Line:       LongInt;          // current line number
     1239  Offset:     LongInt;          // offset position within current line
     1240  InsideDBC:  boolean;
     1241begin
     1242  Offset := 0;
     1243
     1244  if ( Codepage in [ 932, 936, 942, 943, 949, 950, 1381, 1386 ]) then
    12421245  begin
    12431246    // Because parsing of byte types is state based, we must verify every
     
    12471250    CurrentPos := GetCharIndex( FLines[ Line ].Text );
    12481251    P := TextPointer + CurrentPos;
    1249     Offset := 0;
    12501252    InsideDBC := false;
    12511253
Note: See TracChangeset for help on using the changeset viewer.