This paper introduces a novel example-based inpainting algorithm. It is different from traditional methods in two ways. First, it emphasizes the continuity of edges in filling processing because human vision system is sensitive to broken edges. Edge continuity is promised by a new measurement of similarity between texture patches, which gives different weights to different points based on their gradient magnitude during patch propagation. Second, a step of pre-editing on the best matching patch, which adjusts the patch's color according to the patches' boundary, is adopted to make it merge with surroundings more seamlessly. Experimental results show the effectiveness of the proposed algorithm, and demonstrate a better edge continuity and better fusion quality with the original image.