Skip to content

Commit c5fcfc5

Browse files
committed
fix zero ratio issue
1 parent 740afbf commit c5fcfc5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/widgets/DrawingWidget.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ int DrawingWidget::getLineStyle(){
496496

497497
static int num_of_press = 0;
498498
void DrawingWidget::eventHandler(int source, int type, int id, QPointF pos, float pressure){
499+
//printf("%d %d %d\n", source, type, id);
499500
int ev_pen = penType;
500501
if(source & Qt::MiddleButton) {
501502
penType = MARKER;

src/widgets/WhiteBoard.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ void WhiteBoard::paintEvent(QPaintEvent *event) {
111111
);
112112

113113

114+
if (!ratios.contains(drawing->getPageNum())
115+
|| ratios[drawing->getPageNum()] <= 0){
116+
ratios[drawing->getPageNum()] = 100.0;
117+
}
114118
float ratio = ratios[drawing->getPageNum()] / 100.0;
115119

116120

0 commit comments

Comments
 (0)