Mercurial > hg > svgui
comparison layer/RegionLayer.cpp @ 432:8b2b497d302c
* Fix race condition in FFTFileCache when reading from the same FFT model
from multiple threads (e.g. when applying more than one plugin at once)
author | Chris Cannam |
---|---|
date | Wed, 15 Oct 2008 12:08:02 +0000 |
parents | 1304dbe4542e |
children | ac349afdb23f |
comparison
equal
deleted
inserted
replaced
431:4711b400f976 | 432:8b2b497d302c |
---|---|
499 int margin = 8; | 499 int margin = 8; |
500 if (h < margin * 8) margin = h / 8; | 500 if (h < margin * 8) margin = h / 8; |
501 | 501 |
502 getScaleExtents(v, min, max, logarithmic); | 502 getScaleExtents(v, min, max, logarithmic); |
503 | 503 |
504 std::cerr << "RegionLayer[" << this << "]::getYForValue(" << val << "): min = " << min << ", max = " << max << ", log = " << logarithmic << std::endl; | 504 // std::cerr << "RegionLayer[" << this << "]::getYForValue(" << val << "): min = " << min << ", max = " << max << ", log = " << logarithmic << std::endl; |
505 std::cerr << "h = " << h << ", margin = " << margin << std::endl; | 505 // std::cerr << "h = " << h << ", margin = " << margin << std::endl; |
506 | 506 |
507 if (logarithmic) { | 507 if (logarithmic) { |
508 val = LogRange::map(val); | 508 val = LogRange::map(val); |
509 std::cerr << "logarithmic true, val now = " << val << std::endl; | 509 std::cerr << "logarithmic true, val now = " << val << std::endl; |
510 } | 510 } |
511 | 511 |
512 h -= margin * 2; | 512 h -= margin * 2; |
513 int y = margin + int(h - ((val - min) * h) / (max - min)) - 1; | 513 int y = margin + int(h - ((val - min) * h) / (max - min)) - 1; |
514 std::cerr << "y = " << y << std::endl; | 514 // std::cerr << "y = " << y << std::endl; |
515 return y; | 515 return y; |
516 } | 516 } |
517 | 517 |
518 QColor | 518 QColor |
519 RegionLayer::getColourForValue(View *v, float val) const | 519 RegionLayer::getColourForValue(View *v, float val) const |