Skip to content

Commit

Permalink
change interface and fix scalelength
Browse files Browse the repository at this point in the history
  • Loading branch information
Marmare314 committed Aug 14, 2023
1 parent a46f320 commit 77e36c5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/game/editor/component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ void CEditorComponent::Init(CEditor *pEditor)
m_pRenderTools = pEditor->RenderTools();
}

void CEditorComponent::OnRender() {}
void CEditorComponent::OnUpdate(CUIRect View)
{
OnInput();
OnRender(View);
}

void CEditorComponent::OnInput() {}
void CEditorComponent::OnRender(CUIRect View) {}

CEditor *CEditorComponent::Editor() { return m_pEditor; }
IInput *CEditorComponent::Input() { return m_pInput; }
Expand Down
8 changes: 6 additions & 2 deletions src/game/editor/component.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef GAME_EDITOR_COMPONENT_H
#define GAME_EDITOR_COMPONENT_H

#include <game/client/ui.h>

class CEditor;
class IInput;
class IClient;
Expand All @@ -11,7 +13,6 @@ class IGraphics;
class ISound;
class ITextRender;
class IStorage;
class CUI;
class CRenderTools;

class CEditorComponent
Expand All @@ -20,7 +21,10 @@ class CEditorComponent
virtual ~CEditorComponent() = default;

virtual void Init(CEditor *pEditor);
virtual void OnRender();

void OnUpdate(CUIRect View);
virtual void OnInput();
virtual void OnRender(CUIRect View);

CEditor *Editor();
IInput *Input();
Expand Down
2 changes: 1 addition & 1 deletion src/game/editor/map_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void CMapView::ResetZoom()

float CMapView::ScaleLength(float Value)
{
return m_Zoom.GetValue() * Value;
return m_WorldZoom * Value;
}

void CMapView::ZoomMouseTarget(float ZoomFactor)
Expand Down

0 comments on commit 77e36c5

Please sign in to comment.