Merge pull request #7425 from furo321/editor-correct-corners

Use correct corners for brush rotation buttons.
This commit is contained in:
Robert Müller 2023-11-08 19:13:34 +00:00 committed by GitHub
commit fa8640bd35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);