Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Actually every one is right. I ran into something similar not to long ago actually. I couldn't explain it but it felt like the order of operations wasn't being followed correctly. So I broke your equation down so that you can follow the order of the operations. Any way your solution is as followed.</p> <pre><code> int centerX = (screenWidth/gsX); int tempA = ( centerX / 2 ); int tempB = tempA * gsX; NSLog(@"screenwidth / gsX = %i", centerX); NSLog(@"Temp A: %i ", tempA); NSLog(@"Temp B: %i ", tempB); //Veritical [centerLines moveToPoint:CGPointMake(tempB, 0)]; [centerLines addLineToPoint:CGPointMake(tempB, screenHeight)]; </code></pre> <p>Here's whats happening. You're already drawing this line at one point in your grid code. You just have to figure out which one it is.You know that screenWidth/gsX is the last "line that will be drawn. So that number divided by 2 is the middle line. It's already a factor of the screenSize. Then just multiply that number by how big your grid is. Since it is the 'middle line' closest to the center (screenWidth/gsX) your line should show up on top of the grid</p> <p>That should always draw a middle line. I don't see any code where you are changing the color. So you will have to take it on blind faith that it is being drawn. If you can change your line color you should be able to see it. </p> <p>I'll leave it to you to figure out horizontal. (hint: it deals with y value ;-) )</p> <p>I hope this helps!</p> <p>Have fun and good luck Mr. Bourne!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload