mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #7425 from furo321/editor-correct-corners
Use correct corners for brush rotation buttons.
This commit is contained in:
commit
fa8640bd35
|
@ -1137,18 +1137,18 @@ void CEditor::DoToolbarLayers(CUIRect ToolBar)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int s_CcwButton = 0;
|
static int s_CcwButton = 0;
|
||||||
if(DoButton_FontIcon(&s_CcwButton, FONT_ICON_ARROW_ROTATE_LEFT, Enabled, &Button, 0, "[R] Rotates the brush counter clockwise", IGraphics::CORNER_ALL) || (Input()->KeyPress(KEY_R) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr))
|
if(DoButton_FontIcon(&s_CcwButton, FONT_ICON_ARROW_ROTATE_LEFT, Enabled, &Button, 0, "[R] Rotates the brush counter clockwise", IGraphics::CORNER_L) || (Input()->KeyPress(KEY_R) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr))
|
||||||
{
|
{
|
||||||
for(auto &pLayer : m_pBrush->m_vpLayers)
|
for(auto &pLayer : m_pBrush->m_vpLayers)
|
||||||
pLayer->BrushRotate(-s_RotationAmount / 360.0f * pi * 2);
|
pLayer->BrushRotate(-s_RotationAmount / 360.0f * pi * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
TB_Top.VSplitLeft(30.0f, &Button, &TB_Top);
|
TB_Top.VSplitLeft(30.0f, &Button, &TB_Top);
|
||||||
s_RotationAmount = UiDoValueSelector(&s_RotationAmount, &Button, "", s_RotationAmount, TileLayer ? 90 : 1, 359, TileLayer ? 90 : 1, TileLayer ? 10.0f : 2.0f, "Rotation of the brush in degrees. Use left mouse button to drag and change the value. Hold shift to be more precise.", true);
|
s_RotationAmount = UiDoValueSelector(&s_RotationAmount, &Button, "", s_RotationAmount, TileLayer ? 90 : 1, 359, TileLayer ? 90 : 1, TileLayer ? 10.0f : 2.0f, "Rotation of the brush in degrees. Use left mouse button to drag and change the value. Hold shift to be more precise.", true, false, IGraphics::CORNER_NONE);
|
||||||
|
|
||||||
TB_Top.VSplitLeft(25.0f, &Button, &TB_Top);
|
TB_Top.VSplitLeft(25.0f, &Button, &TB_Top);
|
||||||
static int s_CwButton = 0;
|
static int s_CwButton = 0;
|
||||||
if(DoButton_FontIcon(&s_CwButton, FONT_ICON_ARROW_ROTATE_RIGHT, Enabled, &Button, 0, "[T] Rotates the brush clockwise", IGraphics::CORNER_ALL) || (Input()->KeyPress(KEY_T) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr))
|
if(DoButton_FontIcon(&s_CwButton, FONT_ICON_ARROW_ROTATE_RIGHT, Enabled, &Button, 0, "[T] Rotates the brush clockwise", IGraphics::CORNER_R) || (Input()->KeyPress(KEY_T) && m_Dialog == DIALOG_NONE && CLineInput::GetActiveInput() == nullptr))
|
||||||
{
|
{
|
||||||
for(auto &pLayer : m_pBrush->m_vpLayers)
|
for(auto &pLayer : m_pBrush->m_vpLayers)
|
||||||
pLayer->BrushRotate(s_RotationAmount / 360.0f * pi * 2);
|
pLayer->BrushRotate(s_RotationAmount / 360.0f * pi * 2);
|
||||||
|
|
Loading…
Reference in a new issue