acarrillo / sCribble

A collaborative Google Drawing-style sketching program in C
GNU General Public License v3.0
3 stars 1 forks source link

Clunky line drawing #3

Closed acarrillo closed 12 years ago

acarrillo commented 12 years ago

Line drawing is clunky:

  1. Only works for a certain range "negative" slopes
  2. Lines are oddly formed, resulting in variable widths

I am still working on improving the line drawing. Line drawing does have an effect on the pen tool, as scattered dots are connected by lines, so when the line drawing works, so will the pen tool.

acarrillo commented 12 years ago

I may have found a better solution for all this line drawing. As @DoronShapiro predicted, this primitive 2D drawing work already exists for SDL: http://sdl-draw.sourceforge.net/

I am having trouble installing the library, though.

acarrillo commented 12 years ago

Made a new branch to explore sdl-draw. But I still have not yet successfully installed the library on my mac.

vzeddie commented 12 years ago

http://www.programmingsimplified.com/c/graphics.h/line

http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm

acarrillo commented 12 years ago

The first link tells us to use a magic function call in a blackbox "graphics.h", which we do not have. It also does not look like it is SDL-dependent.

But the second link is cool, thanks! I am also trying to make use of SDL_draw, however; I will try that first, and if I do not like it, then I'll go with Bresenham's algo.

acarrillo commented 12 years ago

Fixed by 18332270.