Преглед изворни кода

Merge branch source:main into main

Curtis Hamilton пре 1 недеља
родитељ
комит
f0b2557cb9

+ 6 - 5
packages/fcl-image/src/extinterpolation.pp

@@ -117,13 +117,14 @@ type
     function MaxSupport : double; override;
   end;
 
-  { TBilineairInterpolation }
+  { TBilinearInterpolation }
 
-  TBilineairInterpolation = class (TFPBaseInterpolation)
+  TBilinearInterpolation = class (TFPBaseInterpolation)
   protected
     function Filter (x : double) : double; override;
     function MaxSupport : double; override;
   end;
+  TBilineairInterpolation = TBilinearInterpolation deprecated 'Use TBilinearInterpolation';
 
   { THanningInterpolation }
 
@@ -450,9 +451,9 @@ begin
   result := 1.0;
 end;
 
-{ TBilineairInterpolation }
+{ TBilinearInterpolation }
 
-function TBilineairInterpolation.Filter(x: double): double;
+function TBilinearInterpolation.Filter(x: double): double;
 begin
   if x < -1.0 then
     result := 0.0
@@ -464,7 +465,7 @@ begin
     result := 0.0;
 end;
 
-function TBilineairInterpolation.MaxSupport: double;
+function TBilinearInterpolation.MaxSupport: double;
 begin
   result := 1.0;
 end;

+ 3 - 2
packages/fcl-image/src/fpcanvas.pp

@@ -216,13 +216,14 @@ type
     function MaxSupport : double; virtual;
   end;
 
-  { TMitchelInterpolation }
+  { TMitchellInterpolation }
 
-  TMitchelInterpolation = class (TFPBaseInterpolation)
+  TMitchellInterpolation = class (TFPBaseInterpolation)
   protected
     function Filter (x : double) : double; override;
     function MaxSupport : double; override;
   end;
+  TMitchelInterpolation = TFPBaseInterpolation deprecated 'Use TMitchellInterpolation';
 
   TFPCustomRegion = class
   public

+ 7 - 7
packages/fcl-image/src/fpinterpolation.inc

@@ -118,14 +118,14 @@ begin
       Factor:=double(OldSize-1)/double(NewSize);
       for i:=0 to NewSize-1 do
       begin
-        StartPos:=Factor*i+Factor/2;
+        StartPos:=Factor*(i+0.5);
         StartIndex:=Floor(StartPos);
         PInteger(Entry)^:=StartIndex;
         inc(Entry,SizeOf(Integer));
         // first pixel
-        FirstValue:=(1.0-(StartPos-double(StartIndex)));
+        FirstValue := StartPos-double(StartIndex);
         // convert linear distribution
-        FirstValue:=Min(1.0,Max(0.0,Filter(FirstValue/MaxSupport)));
+        FirstValue:=Min(1.0,Max(0.0,Filter(FirstValue)));
         PSingle(Entry)^:=FirstValue;
         inc(Entry,SizeOf(Single));
         // last pixel
@@ -247,7 +247,7 @@ end;
 
 function TFPBaseInterpolation.Filter(x: double): double;
 begin
-  Result:=x;
+  Result := 1.0 - x;
 end;
 
 function TFPBaseInterpolation.MaxSupport: double;
@@ -255,9 +255,9 @@ begin
   Result:=1.0;
 end;
 
-{ TMitchelInterpolation }
+{ TMitchellInterpolation }
 
-function TMitchelInterpolation.Filter(x: double): double;
+function TMitchellInterpolation.Filter(x: double): double;
 const
   B  = (1.0/3.0);
   C  = (1.0/3.0);
@@ -283,7 +283,7 @@ begin
   result := 0.0;
 end;
 
-function TMitchelInterpolation.MaxSupport: double;
+function TMitchellInterpolation.MaxSupport: double;
 begin
   result := 2.0;
 end;

+ 9 - 7
packages/fv/src/dialogs.inc

@@ -1854,6 +1854,7 @@ Len, I: Integer;
     i : sw_integer;
     st: sw_string;
     wlen : sw_integer;
+    Event : TEvent;  { For new key event. Has to be local variable, can not reuse parent Event. M. }
    begin
      {$ifdef FV_UNICODE}
      wlen:=ASize*2+2;  { over estimate length }
@@ -1872,14 +1873,15 @@ Len, I: Integer;
        If not assigned(validator) or
           Validator^.IsValidInput(st,False)  then
          Begin
-           Event.What:=evKeyDown;
+           Event.What:=evKeyDown;                     { New key event }
+           Event.KeyShift:=0;                         { Clear shift state }
+           Event.KeyCode:=0;                          { Clear key }
            {$ifdef FV_UNICODE}
-           Event.UnicodeChar:=s[i];
+           Event.UnicodeChar:=s[i];                   { Set unicode char }
            {$else}
-           Event.CharCode:=s[i];
+           Event.CharCode:=s[i];                      { Set char }
            {$endif}
-           Event.Scancode:=0;
-           TInputLine.HandleEvent(Event);             { add pasted chars}
+           TInputLine.HandleEvent(Event);             { Add pasted chars }
          End;
        {$ifndef FV_UNICODE}
        if length(st)=255 then break;
@@ -2036,7 +2038,7 @@ BEGIN
 {$ifdef FV_UNICODE}
            Else Case Event.UnicodeChar Of
              ' '..#$FFFF:   { Character key }
-               if (NOT (GetShiftState AND $04 <> 0)) then { Only insert if Ctrl is not pressed }
+               If (Event.KeyShift AND $04 = 0) Then     { Only insert if Ctrl is not pressed }
                Begin
                  If (State AND sfCursorIns <> 0) Then
                    Delete(Data Sw_PString_DeRef, CurPos + 1, 1) Else    { Overwrite character }
@@ -2062,7 +2064,7 @@ BEGIN
 {$else FV_UNICODE}
            Else Case Event.CharCode Of
              ' '..#255:
-               If (NOT (GetShiftState AND $04 <> 0)) Then { Only insert if Ctrl is not pressed }
+               //If (Event.KeyShift AND $04 = 0) Then       { Only insert if Ctrl is not pressed }
                Begin
                  If Data <> Sw_PString_Empty Then Begin   { Character key }
                    If (State AND sfCursorIns <> 0) Then

+ 1 - 1
rtl/inc/systemh.inc

@@ -541,7 +541,7 @@ Type
 { Zero - terminated strings }
 
 {$IF DECLARED(AnsiChar)}
-// Compiler defines AnsiChar and WideChar, not AnsiChar
+// Compiler defines AnsiChar and WideChar, not Char
 {$IFDEF UNICODERTL}
   Char = WideChar;
 {$ElSE}