Cannot draw line of width 1 using ofDrawLine or ofLine

I write the code as follows, but the drawn line is not width 1 but 2, and its color is pale white.

What should I do?

void ofApp::draw() {
    ofSetColor(255);
    ofSetLineWidth(1.0f);
    ofDrawLine(100, 100, 200, 100); // or use ofLine()
}

that’s because antialiasing is enabled, you can disable it calling ofDisableAntialiasing() and you’ll get exact 1px but ragged lines

1 Like

thanks a lot!