Question: My dropdown looks like this:

```
<a uib-dropdown-toggle class="tm-notification" href="">
    <i class="tmn-counts" id="idItemNumber">666</i>
</a>
<div class="dropdown-menu pull-right dropdown-menu-lg">
    <div class="listview">
        <div class="lv-header">
            A title here
        </div>
        <div class="lv-body c-overflow">
            <div class="lv-item">
                <div class="lv-title">
                    <div class="pull-left">Some very long text here</div>
                    <div class="pull-right">01-06-2016</div>
                </div>
            </div> 
        </div>
    </div>
</div>

```

Which results in the `pull-right` div breaking to the next line.

[![enter image description here](https://i.stack.imgur.com/HxmnY.png)](https://i.stack.imgur.com/HxmnY.png)

I'm not sure how many of those css classes are standard bootstrap, but the `dropdown-menu` div's css has:

```
min-width: 300px;

```

If I add `width: 345px;` the result is correct but it's not dynamic anymore.
So I want dropdown-menu's width to depend on its content.

I tried to have all the data in 1 pull-left div

```
<div class="pull-left">Some very very long text here 01-01-2016</div>

```

The width reacts normally but then I don't have the date pulled right.

Answer: 
Your are increasing x and y one every loop. But you can't do this for every triangle. Depend on triangle angle when x increasing , maybe y decreasing. For example if triangle has 90 degree, you will not increase x or y. I can't explain myself very well but there is code and imaged explanation:

> 
> <http://www.sunshine2k.de/coding/java/TriangleRasterization/TriangleRasterization.html>
> 
> 
>
This algorithm works:

```
void function fill_triangle(x1,y1,x2,y2,x3,y3)
  //get length of all sides
  d1 = sqrt(((y2-y1)**2)+((x2-x1)**2))
  d2 = sqrt(((y3-y2)**2)+((x3-x2)**2))
  d3 = sqrt(((y1-y3)**2)+((x1-x3)**2))
  if(((d1<d2)or(d1=d2))and((d1<d2)or(d1=d2))) //the first side is the shortest
    tx = x1
    ty = y1
    vx = (x2-x1)/d1
    vy = (y2-y1)/d1
    counter = 0
    while(counter<d1)
      draw_line(x3,y3,tx,ty)
      //drawing a line from point(x3,y3) to point(tx,ty).
      tx = tx + vx
      ty = ty + vy
      counter = counter + 1
  else if((d2<d3)or(d2=d3)) //the second side is the shortest
    tx = x2
    ty = y2
    vx = (x3-x2)/d2
    vy = (y3-y2)/d2
    counter = 0
    while(counter<d2)
      draw_line(x1,y1,tx,ty)
      tx = tx + vx
      ty = ty + vy
      counter = counter + 1
  else // the third side is shortest
    tx = x3
    ty = y3
    vx = (x1-x3)/d3
    vy = (y1-y3)/d3
    counter = 0
    while(counter<d3)
      draw_line(x2,y2,tx,ty)
      tx = tx + vx
      ty = ty + vy
      counter = counter + 1

```

A visual explanation of what it's doing:
![here](https://i.stack.imgur.com/HrQyx.png)