Procházet zdrojové kódy

renamed evtOnFormCreate to evtFormCreate

mattias před 4 měsíci
rodič
revize
9004211f0f

+ 1 - 1
demo/ScrollBox/MainUnit.lfm

@@ -22,7 +22,7 @@ object MainForm: TMainForm
         Caption = 'Label1'
       end
       object Div2: TDiv
-        Style = 'width: 50px; height: 50px;'
+        Style = 'width: 50px; height: 50px; '
       end
     end
   end

+ 0 - 1
demo/ScrollBox/MainUnit.pas

@@ -34,7 +34,6 @@ implementation
 procedure TMainForm.MainFormCreate(Sender: TObject);
 begin
   Div1.Style:='overflow: auto; width: 200px; height: 50px;';
-
   Label1.Caption:='Fresnel is a visual component library based on CSS and custom drawn components.';
 end;
 

+ 6 - 5
src/base/fresnel.events.pas

@@ -60,15 +60,15 @@ Const
   evtLastControlEvent = evtBlur;
 
   evtAllMouse = [evtMouseMove,evtMouseDown,evtMouseUp];
-    evtAllFocus = [evtFocusIn,evtFocusOut,evtFocus];
+  evtAllFocus = [evtFocusIn,evtFocusOut,evtFocus];
 
   // Form only
   evtFormEvents = evtLastControlEvent;
 
-  evtOnFormCreate         = evtFormEvents + 1;
-  evtOnFormDestroy        = evtFormEvents + 2;
+  evtFormCreate         = evtFormEvents + 1;
+  evtFormDestroy        = evtFormEvents + 2;
 
-  evtLastFormEvent = evtOnFormDestroy;
+  evtLastFormEvent = evtFormDestroy;
 
   // Application only
   evtAppMessages =  evtLastFormEvent + 1;
@@ -112,8 +112,9 @@ Type
   TFresnelEventHandlerRef = TEventHandlerRef;
   {$ENDIF}
 
-  TFresnelUIEvent = class(TFresnelEvent)
+  { TFresnelUIEvent }
 
+  TFresnelUIEvent = class(TFresnelEvent)
   end;
 
   {$IF FPC_FULLVERSION>30300}

+ 2 - 2
src/base/fresnel.forms.pas

@@ -689,14 +689,14 @@ end;
 
 class function TFresnelFormCreateEvent.FresnelEventID: TEventID;
 begin
-  Result:=evtOnFormCreate;
+  Result:=evtFormCreate;
 end;
 
 { TFresnelFormDestroyEvent }
 
 class function TFresnelFormDestroyEvent.FresnelEventID: TEventID;
 begin
-  Result:=evtOnFormDestroy;
+  Result:=evtFormDestroy;
 end;
 
 { TFresnelAfterProcessMessagesEvent }

+ 9 - 0
src/base/fresnel.renderer.pas

@@ -800,6 +800,7 @@ var
   Corner: TFresnelCSSCorner;
   aClientWidth, aClientHeight: TFresnelLength;
   ClipHorizontal, ClipVertical, NeedRestore: Boolean;
+  OldOrigin, NewOrigin: TFresnelPoint;
 begin
   FLLog(etDebug,'TFresnelRenderer.DrawElement %s Origin=%s',[El.GetPath,Origin.ToString]);
   LNode:=TUsedLayoutNode(El.LayoutNode);
@@ -877,15 +878,23 @@ begin
     NeedRestore:=true;
     ClipRect(r);
   end;
+  OldOrigin:=Origin;
   try
+    NewOrigin:=OldOrigin;
+    NewOrigin.X:=NewOrigin.X-El.ScrollLeft;
+    NewOrigin.Y:=NewOrigin.Y-El.ScrollTop;
+    Origin:=NewOrigin;
+
     // Give element a chance to draw itself (on top of background and border)
     aRenderable.Render(Self as IFresnelRenderer);
 
     DrawChildren(El);
+    Origin:=OldOrigin;
 
     // draw scrollbars
     DrawScrollBars(El);
   finally
+    Origin:=OldOrigin;
     if NeedRestore then
       Restore;
   end;