<commit_before>#include "osmwindow.h"

#include <QtCore/QDebug>
#include <QtGui/QPainter>
#include <QtGui/QPaintEvent>

#include "osmtiles.h"


OsmWindow::OsmWindow(QWidget *parent, int zoom) : QWidget(parent), zoom(zoom)
{
    tiles = new OsmTiles(this);
};

void OsmWindow::paintEvent(QPaintEvent *event)
{
    static int i = 0;
    qDebug() << i++ << event->rect();

    int n = 1 << zoom;
    int nx = qMax(n, (event->rect().width()-1)/256+1);
    int ny = qMin(n, (event->rect().height()-1)/256+1);

    QPainter painter(this);
    for (int x=0; x<nx; x++)
        for (int y=0; y<ny; y++)
            painter.drawImage(x*256, y*256, tiles->getTile(zoom, x % n, y));
};<commit_msg>fix downloading all "x" titles for zoom<commit_after>#include "osmwindow.h"

#include <QtCore/QDebug>
#include <QtGui/QPainter>
#include <QtGui/QPaintEvent>

#include "osmtiles.h"


OsmWindow::OsmWindow(QWidget *parent, int zoom) : QWidget(parent), zoom(zoom)
{
    tiles = new OsmTiles(this);
};

void OsmWindow::paintEvent(QPaintEvent *event)
{
    static int i = 0;
    qDebug() << i++ << event->rect();

    int n = 1 << zoom;
    int nx = (event->rect().width()-1)/256+1;
    int ny = qMin(n, (event->rect().height()-1)/256+1);

    QPainter painter(this);
    for (int x=0; x<nx; x++)
        for (int y=0; y<ny; y++)
            painter.drawImage(x*256, y*256, tiles->getTile(zoom, x % n, y));
};
{'fraction_non_alphanumeric': 0.19654427645788336, 'fraction_numerical': 0.028797696184305256, 'mean_word_length': 3.6333333333333333, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6221695', 'n_tokens_mistral': 581, 'n_tokens_neox': 553, 'n_words': 123}