On 2008-12-19, Albrecht Schlosser <[email protected]> wrote:
>
> I'm not aware of such display anomalities, but they can be there...
>
> Could you please post a short (but complete) source file that shows the 
> effect so 
> that we can see _what_ you are doing exactly, and maybe test it?
>
> Albrecht

hey Albrecht, this should do it. its only the relevant 
drawing code. its ugly and i had no time to fix that yet. 
;)
note: i have found that (on mac) linking against an fltk 
lib that uses the other renderer (not Quartz) this code 
draws like expected, like on the win/linux shots. so the 
problem most likely is somewhere inside the Quartz code.



#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Box.H>

class Envelope_Editor: public Fl_Box
{
        void draw();
        int ee_x0, ee_y0, ee_w, ee_h;
        double zoomlevel;
        enum
        {
                vol, fil, aux
        };
public:
        Envelope_Editor(int x, int y, int w, int h, char* const label = 0) :
                Fl_Box(x, y, w, h, label)
        {
                ee_x0 = this->x() + Fl::box_dx(this->box()) + 9;
                ee_y0 = this->y() + Fl::box_dy(this->box()) + 9;
                ee_w = 381; // 3 * 127
                ee_h = 225; // +/- 100 + 20 header + 5 space
                zoomlevel = 2;
        }
};

void Envelope_Editor::draw()
{
        // 0.0 position of coordinate system
        int x0 = ee_x0;
        int y0 = ee_y0 + 125; // 100 + 20 (20 pixel for header, 5 pixel space)
        // background
        fl_color(FL_BLACK);
        fl_rectf(ee_x0, ee_y0 + 25, ee_w, ee_h - 24);
        // coordinate system
        fl_color(50, 50, 50);
        int x_val = x0;
        while ((x_val - x0) / zoomlevel < ee_w / zoomlevel)
        {
                fl_line(x_val, y0 - 100, x_val, y0 + 100);
                x_val += 10 * zoomlevel;
        }
        for (int i = 0; i < 21; i++)
                fl_line(x0, y0 - 100 + 10 * i, ee_w + ee_x0, y0 - 100 + 10 * i);
        fl_color(80, 80, 80);
        fl_line(x0 + 1, y0, x0 + ee_w - 2, y0);
        // frame
        fl_color(fl_darker(FL_BACKGROUND_COLOR));
        fl_line_style(FL_SOLID, 2);
        fl_rect(ee_x0 - 1, ee_y0 + 24, ee_w + 3, ee_h - 21);
}

int main(int argc, char *argv[])
{
  Fl_Double_Window* w;
  { Fl_Double_Window* o = new Fl_Double_Window(400, 240);
    w = o;
    { Envelope_Editor* o = new Envelope_Editor(1, 1, 381, 225, 0);
      o->box(FL_NO_BOX);
    }
    o->end();
        o->show();
  }
 return Fl::run();
}

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to