Skip to content

Rotated line brush pencil is thicker than expected #245

@aseprite-bot

Description

@aseprite-bot

From benoit.l...@gmail.com on June 27, 2013 07:33:28

What steps will reproduce the problem?

  1. Use the pencil tool set to the line brush
  2. Rotate it to around 90° with a size >1
  3. Draw

What is the expected output?
Brush should be a 1px-thick vertical line.

What do you see instead?
Brush is 2px-thick. =( What version of the product are you using? On what operating system? 0.9.5, Fedora 18

Please provide any additional information below.
Updating the rotation computation for the line brush with

    case PEN_TYPE_LINE: {
      double a = PI * m_angle / 180;
      int r = m_size/2;

      x =  cos(a) * r;
      y = -sin(a) * r;
      image_line(m_image, r-x, r-y, r+x, r+y, 1);
>>>
      if (m_angle < 45 || m_angle >= 135)
        image_line(m_image, r-x-1, r-y, r+x-1, r+y, 1);
      else
        image_line(m_image, r-x, r-y-1, r+x, r+y-1, 1);
<<<
      break;
    }

does the trick for near vertical lines, but now I'm frustrated over oblique angles. =D

Original issue: http://code.google.com/p/aseprite/issues/detail?id=245

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions