/* * MathPlanner 3.0 - Mathematical design tool. * Copyright(C) 2002 Jarmo Nikkanen * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation. * * You should have received a copy of the GNU General Public License with this program. * */ #include "BaseStructures.h" #include "Par.h" #include "Error.h" #include #include "Extern.h" void draw_par_class::Draw(int id,int size,int side,QPoint pos,QPainter *paint) { /* QPaintDevice *dev=paint->device(); QPaintDeviceMetrics met(dev); int w=b.width()*met.logicalDpiX()*zoom/2500; int h=b.height()*met.logicalDpiY()*zoom/2500; */ int si; si=(size*sizefactor)/100; if (si<12) si=12; int no=(si-12)/4; if (no>19) no=19; int adj=img_a[id%4][no].height()/2; if (side==0) paint->drawPixmap(pos.x(),pos.y()-adj,img_a[id%4][no]); else paint->drawPixmap(pos.x(),pos.y()-adj,img_b[id%4][no]); } layout_rect draw_par_class::Bounds(int id,int size) { layout_rect o; int si=(size*sizefactor)/100; if (si<12) si=12; int no=(si-12)/4; if (no>19) no=19; int adj=img_a[id%4][no].height()/2; o.ascent=adj; o.descent=img_a[id%4][no].height()-o.ascent; o.width=img_a[id%4][no].width(); return(o); } draw_par_class::draw_par_class() { } void draw_par_class::Init(int id,QString name,QColor b,QColor d,int sf) { Bug("Init Begin"); sizefactor=sf; QRgb bg=b.rgb(); QRgb draw=d.rgb(); QRgb white=qRgb(255,255,255); int i,j,width,height,rat; QImage smooth; QImage image; if (image.load(image_path+name)) { Bug("Start color mux"); if (image.numColors()==0) { for (j=0;j19) no=19; int adj=img_a[id%4][no].height()/2; paint->drawPixmap(pos.x(),pos.y()-adj,img_a[id%4][no]); } layout_rect draw_sigma_class::Bounds(int id,int size) { layout_rect o; int si; si=(size*sizefactor)/100; if (id==2) si=(size*sizefactor*4)/300; if (si<12) si=12; int no=(si-12)/4; if (no>19) no=19; int adj=img_a[id%4][no].height()/2; o.ascent=adj; o.descent=img_a[id%4][no].height()-o.ascent; o.width=img_a[id%4][no].width(); return(o); } draw_sigma_class::draw_sigma_class() { } void draw_sigma_class::Init(int id,QString name,QColor b,QColor d,int sf) { Bug("Init Begin"); sizefactor=sf; QRgb bg=b.rgb(); QRgb draw=d.rgb(); QRgb white=qRgb(255,255,255); int i,j,width,height,rat; QImage smooth; QImage image; if (image.load(image_path+name)) { Bug("Start color mux"); if (image.numColors()==0) { for (j=0;j